Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Undo a git am --abort

Tags:

git

I think I'm hosed, but is there anyway to undo a git am --abort

I was using am and there were some conflicts (as expected), I resolved these conflicts but instead of doing git am --continue I simply committed as normal. Then when I came back later I noticed I was still in am mode but instead of doing git am --skip I did git am --abort and now my commit is gone.

I could of course go through the process again, but I'd rather not perform the conflict resolution again.

EDIT: I resolved my particular issue, but I am still curious if a more robust solution exists. I.e. undo the abort even if the patch was long gone.

like image 582
diedthreetimes Avatar asked Sep 24 '14 20:09

diedthreetimes


People also ask

How do I terminate git am?

The command refuses to process new mailboxes until the current operation is finished, so if you decide to start over from scratch, run git am --abort before running the command with mailbox names.

What does AM command do in git?

What is git am ? git am is a super useful command which can be used for many things as it's reading and parsing the mailbox containing the commits you specify and allows you to use only parts of the extracted data such as the code diff, the autor, the message…

Which command is useful to undo a git rebase?

To check out the original <branch> and remove the .git/rebase-apply working files, use the command git rebase --abort instead.


1 Answers

Turns out git remembered my conflict resolution. The "fix" was as simple as re-running the am command. YMMV I doubt this will work in all situations.

EDIT: git reflog as torek suggested also works.

like image 197
diedthreetimes Avatar answered Oct 06 '22 13:10

diedthreetimes