Reputation: 2741
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?
Upvotes: 1
Views: 109
Reputation:
Your actual HEAD
is merge, so it has multiple parents. If you write HEAD~1
, git must choose from one of the parents. It just chooses the one you do not like.
Use the actual hash instead HEAD~1
in such situations.
Upvotes: 4