To pop a specific stash in git, you can use the git stash apply
command followed by the stash@{NUMBER}
command.
# Get or pop out a specific stash in Git
# "n" refers to the number in the list
git stash apply stash@{n}
For example, to list out all the stashes you have saved into the git stash you can use the,
git stash list
command.
It will show the list of stashes you have saved.
Then you can see something like this in the terminal,
As you can see from the above image, there are 3 stashes called stash@{0}
, stash@{1}
, and stash@{2}
.
To pop out the stash@{2}
you need to type like this to the terminal and press enter,
git stash apply stash@{2}
That's it! 😃