Display every change you made to your repository. It displays the last few actions like commit, rebase, reset and the like.
git reflog
Move the HEAD backward n commits, but don’t change the working directory.
git reset --mixed HEAD~<n>
Move the HEAD backward
git reset --hard HEAD~<n>
Rewriting