I have seen git commands use a syntax such as HEAD~
, but I haven't been able to find this syntax in the Git Reference Manual.
Here is what I have understood: <commit>~<n>
refers to the commit <n> steps earlier than <commit> (where <n> is an integer number), and commit~
simply means the same and that <n> implicitly is one.
Now, is this correct? In that case, does this always work? What if <commit> is the result of a merge between two branches, which commit will then <commit>~
refer to? Is there some corresponding syntax for referring to the next commit or the commit <n> steps later?