I did a
git merge FETCH_HEAD
and, after git told me that there is a conflict in one file, I did a
git mergetool
which in my case runs SourceGear DiffMerge as a GUI mergetool. Immediately after saving the merged file, I realized that I made a bad mistake. I just want to forget the merge and do it all over.
Since I didn't have executed a "git add" yet, let alone committed anything, I thought I could erase my mistake and redo the merge easily like this:
git reset FILENAME
git merge FETCH_HEAD
git mergetool
This does not work. "git merge" by this time tells me
fatal: You have not concluded your merge (MERGE_HEAD exists).
Please, commit your changes before you can merge.
But of course I don't want to commit the screwed-up merge. "git mergetool" complains
No files need merging
I guess I made a mistake at the "git reset" command. What is the proper way to do this?
ADDING:
I did
git merge --abort
then again:
git merge FETCH_HEAD
This yielded
error: Your local changes to the following files would be overwritten by merge: ...
git status
says:
On branch ....
Your branch is up-to-date with ......
Changes not staged for commit:
modified: nVP.ini
Untracked files:
nVP.ini.orig
no changes added to commit (use "git add" and/or "git commit -a")
Just an idea: Would simply a git checkout of nVP.ini bring back the situation before the merge?
nVP.ini
is the conflict file you can justgit checkout HEAD -- nVP.ini
.git reset
just resets the index entry, you want the worktree clean too, so checkout the HEAD version. During a merge you can alsogit checkout --ours nVP.ini
for the same effect,