Skip to content
>devspeak
← glossary
level 3Git & Version Control

Stash

also: stashed, stashing, git stash

Temporarily setting aside your uncommitted changes so you have a clean slate, then bringing them back later.

a bit more technical

"git stash" saves uncommitted changes to tracked files and returns the working tree to the last commit. "git stash pop" reapplies them. Untracked (brand-new) files aren't included unless you add the -u option.

picture it

Sweeping your half-done puzzle into a labeled box so the family can eat dinner at the table, then pouring it back out afterward.

why it matters

Stash is a safe way to clear your unfinished edits out of the agent's way without losing them, and without making a messy commit.

what your agent might say
agent
You have uncommitted changes in 3 files. I'll stash them, switch to main for the hotfix, then run git stash pop to restore them when we're done.
how you might use it
you → your agent
Stash my current changes, including new files, before you switch branches, and remind me to restore them when you're done.
common mistake

Assuming stash saves everything. By default it skips brand-new files Git isn't tracking yet. And a stash is local to your computer, not a backup.

builds on