Git: Recovering a lost commit
Published:
# List head history and find the lost commit (should be among first ones)
$ git reflog
# Switch to the correct branch (if necessary?)
$ git checkout master
# Hard reset head to the lost commit
git reset --hard 1dd3a55
- Source