How to stash a directory or file | The Git Stash Command
Stashing means saving your local changes away. Your working directory will be reverted to match the HEAD commit. It might be that you want to stash the changes of your whole working directory (aka everything) or that you want to stash a directory.
How to stash your whole working directory
In Git you can stash the changes of your whole working directory by using the Git stash command:
How to stash a directory or file
In case that you want to stash the changes of a specific directory or file, you can use the following Git stash command:
git stash push -- path/to/folder/or/file
For full reference see Git stash documentation.