Stash work in progress

Low risk
What do risk levels mean?
Read-only
Inspects state without changing anything.
Low risk
Reversible with a routine follow-up command.
Medium risk
Changes state; undo path documented.
Destructive
Deletes or overwrites; confirmation required.

Saves uncommitted changes (including untracked files) to the stash and cleans the working tree, so you can switch tasks without committing.

gitstashworking-tree

Parameters

Label stored with the stash entry so it is easy to find later.

Commands

Review the changes that will be stashed

git status --short

Save all uncommitted changes to the stash and clean the working tree

git stash push --include-untracked -m "work in progress"

Verification

git stash list

The new stash entry appears at the top with the chosen message.

Undo

Restore the stashed changes to the working tree and drop the stash entry

git stash pop

Pitfalls

  • git stash pop can hit conflicts if the branch changed since stashing; resolve them like merge conflicts.
  • Ignored files are not stashed unless --all is used instead of --include-untracked.

Related