Here is my git log:
I want to reset the most recent commit (top).
If I run git reset --hard HEAD~1, however, it takes me back by five commits!
Similarly, if I run git rebase -i HEAD~3, I expect to see the most recent three commits appear, but instead I get about 50!
What could be going wrong?
Your actual
HEADis merge, so it has multiple parents. If you writeHEAD~1, git must choose from one of the parents. It just chooses the one you do not like.Use the actual hash instead
HEAD~1in such situations.