Skip to content

Git Stash

Commands

git stash save "message"
git stash list
git stash apply stash@{1}

git checkout stash@{1} -- somedirectory
# only apply stash changes to specific files

# interactive mode
git stash save -p "my commit message"

# see stashed files
git stash show stash@{1}

# see stash contents
git stash show -p stash@{1}

More.

Squash last n commits

git reset --soft HEAD~n
git commit -m "new message"

More here.