I have accidentally deleted a file with mercurial and am wondering if it is
possible to restore it.
Here is my log:
$ hg add main.py
$ hg commit -m "message"
$ hg push
abort: push creates new remote heads!
(did you forget to merge? use push -f to force)
$ hg pull
added 1 changesets with 1 changes to 1 files (+1 heads)
(run 'hg heads' to see heads, 'hg merge' to merge)
$ hg update
abort: crosses branches (use 'hg merge' or 'hg update -C')
$ hg merge
abort: outstanding uncommitted changes
$ hg update -C
removing main.py
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
Now my main.py file is deleted. Not just removed from repository but deleted
from file system! Very frustrating!
Is there any way to restore it from mercurial's meta data?
Richard
--
View this message in context: http://mercurial.808500.n3.nabble.com/how-to-restore-file-deleted-with-update-C-tp2491483p2491483.html
Sent from the General mailing list archive at Nabble.com.
_______________________________________________
Mercurial mailing list
Merc...@selenic.com
http://selenic.com/mailman/listinfo/mercurial
hello,
I have accidentally deleted a file with mercurial and am wondering if it is
possible to restore it.
Here is my log:
$ hg update -C
removing main.py
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
Now my main.py file is deleted. Not just removed from repository but deleted
from file system! Very frustrating!
Is there any way to restore it from mercurial's meta data?
Fortunately, not even hg update -C will touch untracked files (unless
the revision we're updating to has a file with the same name). The fact
that main.py was removed, indicates that not all hope is gone.
--
Robert Bauck Hamar
USIT/SAPP/GT - Cerebrum
http://www.uio.no/sok?person=hamar
Note: This is not saying you should do this without knowing what the
commands do.
>$ hg merge
>abort: outstanding uncommitted changes
Outstandning uncommitted changes? Is there something you did that you
did not tell us between here and the "hg commit" above?
>$ hg update -C
>removing main.py
>0 files updated, 0 files merged, 1 files removed, 0 files unresolved
>
>
>Now my main.py file is deleted. Not just removed from repository but deleted
>from file system! Very frustrating!
>Is there any way to restore it from mercurial's meta data?
Yes.
$ hg heads
Will list a number of heads, one of which is your last revision
containing the newly created main.py. "hg update" can take you back to
that revision.