I have a git repository that looks like this:
A <- B <- C <- D <- HEAD
I want the head of the branch to point to A, i.e. I want B
None of those worked for me, so I had three commits to revert (the last three commits), so I did:
git revert HEAD git revert HEAD~2 git revert HEAD~4 git rebase -i HEAD~3 # pick, squash, squash
Worked like a charm :)