I think the main confusion isn't about git diff
but about HEAD
and HEAD^[num]
and HEAD~[num]
.
EDIT:
HEAD
means the current branch you are working at.
And HEAD^[num]
means the num'th parent point of a multi-parent node. For a single parent node, [Commit]^[2 or greater] is an invalid expression. ( And git will warn this by fatal: ambiguous argument '1f9a20d^2': unknown revision or path not in the working tree.
)
The HEAD~[num]
means the num'th ancester commit of a commit node. For a merging node, the ancester is the branch branch you were on when you merged.
Ref this link and this link to read more about HEAD
related.
The following picture shows a several way of using Ancestry References in a quite simple situation.
ps. Sincecely apology for previous wrong answer and thanks @torek a lot for correcting it out.