how to abort the merge in git code example Example 1: git merge abort git merge --abort Example 2: git stop merge git reset --hard HEAD