Git stash to save changes before checkout to different branch

Saving changes before checkout to different branch

Stash your changes

git stash

Get the changes back

git stash apply

Is stash branch specific or for the whole repo
A stash is for the whole repo. Its a stack of saved files. An entry of currently modifed files is added on top of stack with an git stash operation.

To see the current stash stack:

git stash list

To pick a specific stash from the stack, refer to it by the stash@{number} shown by the above.

git stash show stash@{<number>}
git stash show stash@{2}