What is the difference between git stash pop and git stash apply?
Both reapply stashed changes to your working tree. pop also deletes the stash entry afterwards, while apply keeps it, so you can reuse it on another branch.
Explain it simply
Apply is photocopying a note from a drawer; pop is taking the note out and leaving the drawer empty.
Use pop for the usual case: you stashed, switched, did something, and now want your work back. Use apply when you want the same changes on more than one branch, or want to keep a safety copy. If pop hits a conflict, Git keeps the stash anyway, so you do not lose it. Clean up later with git stash drop.
Example
git stash list
# stash@{0}: WIP on main: 3a4b5c6 Add header
git stash apply stash@{0} # keep the stash
git stash pop # apply newest and delete it
git stash drop stash@{1} # delete a specific stashWhat to say in the interview
"pop applies the stash and removes it, apply applies it and keeps it. I use pop normally and apply when I need the same change on several branches. If pop conflicts, the stash is kept."