git merge abort with conflicts reset head code example Example 1: git merge abort git merge --abort Example 2: git stop merge git reset --hard HEAD