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