cancel git stash merge code example Example 1: git stash apply undo merge conflict git reset HEAD . Example 2: git stash changes before merge git stash pop