Yes
Git Stash:
Git stash temporarily shelves (or stashes) changes you've made to your working copy so you can work on something else, and then come back and re-apply them later on. Stashing is handy if you need to quickly switch context and work on something else, but you're mid-way through a code change and aren't quite ready to commit.
![enter image description here](https://cdn.statically.io/img/i.sstatic.net/f1HcN.png)
Stashing is available in VS 2019 and later versions.
- Go to Git changes window
Ctrl + Alt + F7
- Now press the drop down key near
Commit All
or Commit staged
button to see the stashing options
Option 2:
You can use this option Stash All and Keep Staged (--keep-index)
by default
![enter image description here](https://cdn.statically.io/img/i.sstatic.net/coc0J.png)
Option 1:
Only if you want to stash untracked files like Git ignored files
or Files which are not included into project
then go for this option
![enter image description here](https://cdn.statically.io/img/i.sstatic.net/SMvy2.png)
You can keep/save multiple stashes with description like below:
![enter image description here](https://cdn.statically.io/img/i.sstatic.net/4PhQk.png)
Retrieving a stash:
You have two options, either to Apply or Pop.
Apply
will retrieve the stash but wont delete the stash but Pop
(Apply + Delete) will retrieve the stash and will also delete it.
![enter image description here](https://cdn.statically.io/img/i.sstatic.net/millc.png)
Again, Under Apply/Pop
you gonna see two options:
Apply/Pop and restore staged (--index)
Always use this option by default. This means while stashing if you had some files in changes and some files in staged, it'll be restored as such to changes and staged.
Apply/Pop all as unstaged
If you use this option, while stashing if you had some files in changes and some files in staged, all of these files now will be clubbed to Changes.
![enter image description here](https://cdn.statically.io/img/i.sstatic.net/parMm.png)