How do you cancel a merge that went wrong?
Run git merge --abort. It restores your branch and working tree to the state before the merge started. It works while the merge is still unresolved and uncommitted.
Explain it simply
You started a merge, saw forty conflicted files and thought 'not today'. There is an exit.
git merge --abort throws away the half-done merge and returns you to exactly where you were. If you already committed the merge, abort no longer applies; use git reset --hard ORIG_HEAD right after the merge, or git revert -m 1 if it was pushed. Similar escape hatches exist for other operations: git rebase --abort and git cherry-pick --abort.
Example
git merge feature/redesign
# CONFLICT (content): Merge conflict in app.css
git merge --abort
git status # clean againWhat to say in the interview
"git merge --abort returns to the pre-merge state if the merge is still in progress. After a committed merge I would use reset to ORIG_HEAD if unpushed, or revert -m 1 if pushed. Rebase and cherry-pick have their own --abort."