Using hg revert in Mercurial

As other's have pointed out, you can safely delete these files.

You can remove them by executing this command from the root of your repo:

rm `hg st -un | grep orig`

If you want to revert, and don't care at all about backing up the original files, the command you want is:

hg update -C

I find the purge extension handy. Usage:

hg purge

"This extension purges all files and directories not being tracked by Mercurial"

...including the .orig files but excluding ignored files (unless you use --all).


Yes, you can delete them. It's a safety feature in case you reverted something you didn't mean to revert.


You can also use the flag --no-backup and the .orig files will not be created

hg revert --no-backup filename.java

As of Mercurial 2.0, you can instead use the flag -C to supress the .orig files from being created

hg revert -C filename.java

Tags:

Mercurial