git -- how to recover from unfinished merge
Asked Answered
B

1

6

I started the mergetool ...

> git mergetool

And it said something like ...

merge tool candidates: blah blah blah
Merging:
file1.c

And then I thought, "You know, I'm not ready for this." Not knowing any clean way to shut it down, I hit ctrl-C. Now I want to check out another branch, but I can't ...

> git checkout other_branch
error: path 'file1.c' is unmerged

Is there some way to recover from this? I emphasize that I made no actual changes when mergetool was running.

Blakley answered 17/11, 2016 at 22:43 Comment(0)
G
9

You're looking for the --abort option which exists in most git commands:

git merge --abort

Manual entry:

Abort the current conflict resolution process, and try to reconstruct the pre-merge state.

Gertrudgertruda answered 18/11, 2016 at 1:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.