Last Updated: 2021-05-15
I had previously thought
git HEAD~2 was equivalent to
git HEAD^2. This is untrue.
Say the last commit was a merge commit. Then:
HEAD^n gives the nth "horizontal" parent of HEAD. But this only means something when there's
a merge commit. Here, therefore, HEAD^1 is "a" (the main branch) and HEAD^2 is "b" (the merged in branch)
HEAD~ gives the first parent. Always. Therefore HEAD~2, means the first parent of the first parent. So here it will be the parent of "a", i.e. "a-parent". So "vertical"