git reflog

If you lost a commit in the sea of commits or accidentally made a commit to a detached HEAD

git reflog