Ad space (banner)
🌿Git Lessons
Lesson 14 / 59

Shelving Work Temporarily with git stash

This lesson covers temporarily shelving work with git stash. It's for anyone searching "git stash usage."

git stash temporarily sets aside changes you're not ready to commit yet. It's handy when you suddenly need to switch to another task without interrupting your current, uncommitted work.

In Try It, run git stash. Your current changes are moved to a temporary holding area, and your working directory returns to a clean (unchanged) state.

A common early mistake is forgetting to bring stashed changes back — a stash doesn't restore itself automatically, so you need to explicitly bring it back with git stash pop or git stash apply. In real teams, stash is frequently reached for when an urgent bug fix comes in and you need to set aside your current work to switch branches.

Git
Try it (type this into the pseudo terminal)
git stash

🧑‍💻 You can type this command into the Git pseudo terminal to try it yourself (this page itself has no interactive terminal).

Ad space (banner)
Ad space (in-article)