It took one branch to another. When merging, there was a conflict in one file. When resolved, the file was edited incorrectly. How can I undo changes in a file?
To make it the same as it was immediately after the merger attempt, I tried to do so.

git checkout myfile.c 

received an answer

error: path 'myfile.c' is unmerged

The rest did not try, so as not to do harm by accident.

  • It is not clear what status you have merge. What does git status give? If you assume that you just fixed the code and didn’t finish it, then the easiest way is to do a git merge --abort and start the merge from the beginning. - a-bobkov
  • Yes, this is what will suit me, thank you. - Vitaly Karpenko

1 answer 1

If you assume that you just fixed the code and didn’t finish it, then the easiest way is to do a git merge --abort and start the merge from the beginning.