I accidentally ran hg revert
and lost all changes to my file foo.js
. I see that a backup of the file exists as foo.js.orig
. How can I add the orig file back so that I can reinstate my changes?
Update: I used hg add foo.js.orig
to add the file back, but how can I replace the existing foo.js
file with the original foo.js.orig
file? I am new to mercurial so any help appreciated, thanks!
I solved this by:
hg add foo.js.orig
hg rename -f foo.js.orig foo.js
(this replaces the existing-but-outdated foo.js file)