In a larger git merge with several conflicting files, I incorrectly marked a file as resolved (using git add FILE after some editing)
Now I’d like to undo my conflict resolution attempt and start over resolving that file.
How can I do that?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use
git checkoutwith flag--merge(short version-m):This restores the unresolved state, including all information about parent and merge base, which allows restarting the resolution.
This command can also be used to "undo" automatic merge conflict resolution, if
rerereis enabled in your git config. This is especially useful with enabledrerere.autoUpdateafter it records incorrect merge conflict resolution and you notice too late.Found the solution here: http://gitster.livejournal.com/43665.html