how to undo merge in middle code example Example 1: abort merge git git merge --abort Example 2: cancel a merge git git merge --abort