Cancel a merge with conflicts
Safe: nothing is lost
Short answer
Run git merge --abort. The merge stops and your files go back to how they were before you started it.
The commands, one by one
- 1
git statusShows you're in the middle of a merge, with the conflicted files under Unmerged paths.
- 2
git merge --abortCancels the merge: conflict markers and half-merged files are gone, and the branch is untouched.