Save all WIP changes in stack
git stash
Save unstaged changes in a stack with comments
git stash save "comment"
Use push
with space separation to stash specified files
git stash push file_1 file_2
View the list of stashes in the stack
git stash list
View the file-level diff vs last stash
git stash show
View the line-level diff vs last stash
git stash show -p
View the diff vs specific stash index number
git stash show -p stash@{n}
View the diff of n-th
stash against branch name
git diff stash@{n} branch_name
Apply the most recent stashed changes (removes the stashed commit in the stack)
git stash pop
Apply n-th
stash index diff
git stash apply n
OR
git stash pop "stash@{n}"
Apply the most recent stashed changes (keeps the stashed commit in the stack)
git stash apply
Delete the most recent stash from the stack
git stash drop
Delete the n-th
stash from the list
git stash drop stash@{n}