cancel a merge in git code example Example 1: cancel merge git merge --abort Example 2: abort merge git git merge --abort