Take the 2-minute tour ×

I have a file that was deleted a few changesets ago. As you can imagine, the other files in my project have changed since then. How can I get back that file (it's actually 2 files) without reverting all the other source files?

share|improve this question

1 Answer 1

up vote 10 down vote accepted

Use hg revert for just that file:

hg revert -r REV path/to/deleted/file

From the help for hg revert

If a file has been deleted, it is restored. If the executable mode of a file was changed, it is reset.

If names are given, all files matching the names are reverted. If no arguments are given, no files are reverted.

share|improve this answer
Thanks! Maybe I wasn't looking hard enough but I couldn't find that info anywhere. –  Pete Apr 11 '11 at 20:28

Your Answer


