Recover history on "hg remove" & "hg add" instead of "hg move"

Steve Barnes GadgetSteve at hotmail.com
Wed May 5 05:58:10 UTC 2021


Hi Manish,

If you have made no other commits since then you can:
  hg backout -r R
where R is the revision that did this. Then use:
  hg move
to move the directory.

If you have made other commits you can potentially:
Use hg diff to dump out all of the changes after the problem and then use
  hg update -r R
where R is the revision before you did this to get back to the state you were in. Then use:
  hg branch
To create a new branch, and use:
  hg move
to move the directory. And use:
hg graft
to apply the later changes.

The nice thing about all decent version control tools is that they provide a time machine.

Hope that helps.

Steve Barnes


From: Mercurial <mercurial-bounces at mercurial-scm.org> On Behalf Of Manish Dusane
Sent: 30 April 2021 00:56
To: mercurial at mercurial-scm.org
Subject: Recover history on "hg remove" & "hg add" instead of "hg move"

Hi,

A novice question,

Sequence of steps taken :
branched off default,
"hg remove" a directory (all files in it)
moved it to a new location , "hg add" ed it.
Merged back default

Now i have lost history of the said directory from default, as it got overwritten.
(I realise should have used "hg move".)

What is the way to recover the history ?

TIA,
-Manish

--
The surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us - Calvin and Hobbes.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mercurial-scm.org/pipermail/mercurial/attachments/20210505/2cdef3fd/attachment.html>


More information about the Mercurial mailing list