What is difference between git stash pop and git stash apply?

Technology CommunityCategory: GitWhat is difference between git stash pop and git stash apply?
VietMX Staff asked 3 years ago

git stash pop throws away the (topmost, by default) stash after applying it, whereas git stash apply leaves it in the stash list for possible later reuse (or you can then git stash drop it).

This happens unless there are conflicts after git stash pop (say your stashed changes conflict with other changes that you’ve made since you first created the stash), in this case, it will not remove the stash, behaving exactly like git stash apply.

Another way to look at it: git stash pop is git stash apply && git stash drop.