Github Logo

If you are using GIT as an SCM tool for you application, often times you need to save your working copy of the files and move to some other branch or perform an urgent task on the application source code. GIT Stash comes handy in these situations.

Using Git stash, you can stash multiple working version of your source code and pop them one by one using the following command:

git stash pop

This command will simply pop the last saved (latest) working tree of the source code.

However, there are times when you need to simply pop some older working tree from the stash. In that case, you can use the following command to achieve this result.

git stash list

This command will list all the stashed items. You need to pick a number of the stash that you want to pop and provide it to the command below.

git stash apply stash@{<STASH_INDEX>}

This will pick up the particular stash from the number that you provide to it and apply it to the source code.


If this GIT command is not working for you, or if you are facing issues while executing this command, add a comment in the comments section below and I will try to help you out!