If you made
git reset --hard by mistake, possibilities are you can still get your commit back, as git holds a log of everything for a few days. This is only valid if your work is backed up, i.e., by committed or stashed. As
git reset --hard removes uncommitted changes, so be careful before going into trouble.
The much reliable choice is to run the following command.
git reset --keep
Alternately, you can check the list of your past commits and choose the SHA of the commit you want:
Now, run the following command to get your changes back:
git reset --hard SHA1234