Skip to content

Git Stash Pop

In one line

git stash pop reapplies the most recent stashed changes to the working tree and removes them from the stash list.

In simple words

git stash pop reapplies the most recently stashed changes (stash@{0}) to your working directory and then drops that stash entry. It is the inverse of git stash — stash saves your uncommitted work, pop restores it. This is the common way to switch context and come back.

If applying the stash would conflict with current changes, pop applies what it can and leaves conflicts in the working tree for you to resolve. The stash entry is kept only if the apply failed; on success it is dropped. Use git stash apply to restore without dropping, in case you want to apply the same stash elsewhere.

You can pop a specific stash with git stash pop stash@{2}. If you pop in the wrong branch or the changes conflict badly, you can undo with git checkout . (carefully) or restore the stash from the reflog. Stash is a stack — push and pop — but entries are also reachable via reflog until garbage collected.

Example

bash
# Save current work, switch context, come back
echo "wip" >> file.txt
git stash            # saved as stash@{0}
git status           # working tree clean
git checkout main    # do something else
git checkout feature
git stash pop        # reapply and drop stash@{0}
# file.txt now has "wip" again

# Apply a specific stash without dropping
git stash apply stash@{1}

stash saves uncommitted work; pop restores the top entry and drops it. apply restores without dropping. Conflicts leave the stash in place.

Related terms

Related Resources

Related Lessons

Decode error messages

Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.

View errors

← Back to glossary