The closest answer is this one, and here's a line from it:
hg revert -r <oneRevBack> fileName
The last thing is to get <oneRevBack>
other than using hash. I would dream of just typing <-1>
.
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".
来源:https://stackoverflow.com/questions/20971306/hg-how-do-i-revert-a-single-file-several-commits-back