When I specify an ancestor commit object in Git, I\'m confused between HEAD^ and HEAD~.
HEAD^
HEAD~
Both have a \"numbered\" version like HEAD^3<
HEAD^3<
The ^ format allows you to select the nth parent of the commit (relevant in merges). The ~ format allows you to select the nth ancestor commit, always following the first parent. See git-rev-parse's documentation for some examples.
^
~