Interactive Stashing
suggest changeStashing takes the dirty state of your working directory – that is, your modified tracked files and staged changes – and saves it on a stack of unfinished changes that you can reapply at any time.
Stashing only modified files:
To leave staged changes in the index and working tree, use:
git stash --keep-index
The stash still records those staged changes. They also stay staged. Only the unstaged modifications are removed from the working tree.
Stashing untracked files:
git stash does not save untracked files. It only stashes modifications to tracked files, including staged ones. To stash untracked files as well:
git stash -u
This stashes untracked files together with staged and unstaged changes to tracked files. Ignored files are still left out unless you use -a / --all.
Stash some particular changes only:
To stash only some hunks, or only some of the modified files:
git stash --patch
Git will not stash everything that is modified but will instead prompt you interactively which of the changes you would like to stash and which you would like to keep in your working directory.