stash is a very powerful concept, it’s like Harry Potter’s Room of Requirement for your code, you throw it in here and you can get it back when you need it again in the future.
But dealing with it can be dangerous.
git stash pop throws away the stash after applying it.
git stash apply leaves it in the stash list and can be reused later (or dropped using
git stash drop)
note: If during a
popthere are conflicts it behave exactly like git stash apply and the stash will not be lost
git stash pop is equivalent to
git stash apply && git stash drop
git stash apply can be a life-saver somethimes when you mess up with taking something from the stash
image credit: ancientking