No, HEAD^ and HEAD~1 (as well as HEAD~ or HEAD^1 ) refer to the same commit.
Adding ^ or ~ after something that describes the commit will change the reference to the first parent of the commit described by the previous part of the argument.
The difference occurs when a number follows a character. If the number is not specified, it works the same as if 1 were used.
The number following ^ selects which parent of the merger should be used (to some extent, as the choice of father or mother). The first parent will be the commit, which was checked when the merge commit was created, other parents will be declared using the git merge command.
The number following ~ refers to the number of generations that return (after the parentβs first relationship at each step), 1 to the immediate parent, 2 to the parent, etc.
These notations can also be encoded, for example HEAD~3^2~5 , although it is usually simpler to simply use the SHA1 identifier to refer to commits that need this type of notation.
source share