newbie question - recovering removed files

Mike Barretta mike.barretta at gmail.com
Fri Oct 30 21:29:58 UTC 2009


the wrinkle i didn't mention was that i'd created a branch to contain
the revisions that i'd removed files from.

what i learned was when i do an update from one branch to another, i
need to do an hg update -C to get a clean copy

On Fri, Oct 30, 2009 at 4:51 PM, Jim Hague <jim.hague at acm.org> wrote:
> On Friday 30 Oct 2009 19:41:38 Mike Barretta wrote:
>> from some revision of a repository, i delete files from my local copy
>> and remove them from the repo.  if i revert to the revision prior to
>> the file removal, i don't get the files back.  is this expected or am
>> i doing something wrong?
>
> It's difficult to tell without knowing exactly what commands you have used.
>
> In general, yes, you would expect to get the files back.
>
> $ hg init
> $ echo "Hello, world" > foo
> $ hg add foo
> $ hg commit -m "Hello"
> $ hg rm foo
> $ ls
> $ hg commit -m "Goodbye"
> $ hg log
> changeset:   1:a651a830b8dd
> tag:         tip
> user:        Jim Hague <jim.hague at acm.org>
> date:        Fri Oct 30 20:47:35 2009 +0000
> summary:     Goodbye
>
> changeset:   0:f799cec56212
> user:        Jim Hague <jim.hague at acm.org>
> date:        Fri Oct 30 20:47:20 2009 +0000
> summary:     Hello
>
> $ hg update -r 0
> 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
> $ ls
> foo
>
> Is that what you did?
> --
> Jim Hague - jim.hague at acm.org          Never trust a computer you can't lift.
> _______________________________________________
> Mercurial mailing list
> Mercurial at selenic.com
> http://selenic.com/mailman/listinfo/mercurial
>




More information about the Mercurial mailing list