evolve: revert amend

Faheem Mitha faheem at faheem.info
Mon Aug 11 08:41:02 CDT 2014


On Mon, 11 Aug 2014 12:25:52 +0300, anatoly techtonik <techtonik at gmail.com> wrote:
> On Mon, Aug 11, 2014 at 12:22 PM, anatoly techtonik <techtonik at gmail.com> wrote:
>>
>> I've was fixing a typo and accidentally amended all changes
>> to a commit, is there a way to revert amend so that my
>> modifications are not lost?
>
> $ hg uncommit
> abort: nothing to uncommit

> I want to get back to 3171 and get back modifications to other files
> in not-committed state. It that undo is possible?

    hg uncommit -a

for all the files (which I think is what you want), otherwise you can
pass filenames as arguments.

3173 will drop back to 3170, though, not 3171. 3171 is marked as
obsolete. Is that really what you want?

It will prompt you for

    hg prune .

to get rid of the resulting empty cset.

                       Regards, Faheem

> @  changeset:   3173:79c37431f559
>|  tag:         tip
>|  parent:      3170:4d0047e4dd50
>|
>| x  changeset:   3172:1a7eaca96f66
>| |  temporary amend commit for 60196217f989
>| |
>| x  changeset:   3171:60196217f989
>|/
>|
> o    changeset:   3170:4d0047e4dd50
>|\   parent:      3169:fcf21e6806af



More information about the Mercurial-devel mailing list