The hg syntax for "one rev back" is tip^
, where tip
is the latest revision and ^
means "parent". If your working directory is not at tip, use .^
, where the dot means "current revision".
You can use hg revert -r tip~n file
to revert to the n
th ancestor of the tip (using the first parent if a commit has two parents). You can use -(n+1)
only if there's only a single branch. -1
refers to the last revision, -2
the penultimate revision, and so forth, in order of revision numbering and not following the branch structure. (See hg help revsets
for more details.)