How can I stop a Git merge that I have not finished resolving?
Quick answer
If a merge is still in progress and you want to abandon it, first inspect git status and preserve any unrelated uncommitted work. Then run git merge --abort. Git intends this to undo the merge’s in-progress index and working-tree changes and return to the pre-merge state. It may not reliably reconstruct pre-existing uncommitted changes, especially if they were modified during the merge, so check the result afterward. [S1]
The question, the details, the next step.
A practical checklist
Run
git statusand inspect the repository state.Review the changes and identify work unrelated to the merge.
Preserve uncommitted work you need before aborting; pause if you cannot safely distinguish it.
Run
git merge --abortonly if you intend to abandon the in-progress merge.Run
git statusafterward and inspect the result.
A few more useful answers
Does `git merge --abort` guarantee that all my pre-merge edits will come back?
No. Git cautions that abort may not reliably reconstruct pre-existing uncommitted changes, especially if they were modified during the merge. Preserve important unrelated work first. [S1]
Should I run `git merge --abort` if I want to keep resolving the conflicts?
No. The command is intended to abandon the in-progress merge. If you want to continue resolving it, do not use it.
What if I cannot tell whether a change is mine or part of the merge?
Pause and preserve the work before taking action. If the repository state remains unclear, ask someone who can inspect that repository rather than guessing.
Sources
References used for this guide.
- [S1] Git git-merge documentation: aborting a merge git-scm.com · Checked
