git undo commit and stash changes code example Example 1: how to undo a git stash git stash apply Example 2: how to stash and undo stash git stash pop