Git stash: safely set work aside
Set half finished work aside without committing, do something else and bring it all back exactly as it was. When a stash helps and what to watch for.

What a stash is
A stash is a safe holding area for changes you do not want to commit yet but also do not want to lose. You set your current work aside, the working directory becomes clean, and you can do something else. Later you bring the changes back exactly as they were.
When a stash helps
The classic case: you are working on one thing, and suddenly you have to do something else urgently, such as fixing a quick bug on another branch. Your half finished work is not ready to commit. Instead of making an unfinished commit, you stash it, switch branches, handle the urgent thing, and bring your work back afterwards.
Other cases: you want to test a clean state briefly, pull an update that would clash with your local changes, or you notice you started on the wrong branch.
The flow in short
- Create a stash: your changes move onto the stash stack, the working directory becomes clean.
- Do something else: switch branch, test, update, whatever.
- Bring the stash back (apply or pop): your changes are in the working directory again.
The difference between apply and pop: apply keeps the stash entry, pop removes it after restoring. If you are unsure, use apply, so you keep a backup until you know everything fits.
Multiple stashes and order
The stash is a stack, so you can create several. That is handy but quickly gets confusing. Give stashes a short description so you know later what is inside. A stash without a note is a riddle after three days.
What to watch for
- A stash is local. It is not pushed and lives only on your machine.
- New, untracked files are not stashed by default. If you need them, you have to ask for it explicitly.
- Restoring can cause a conflict if the branch has changed in the meantime. That is normal and resolves like any merge conflict.
How Spire helps
In Spire you see your stashes as a clear list with their descriptions, instead of having to keep them in your head on the command line. You create a stash, bring it back or discard it with a few clicks, and if restoring causes a conflict, Spire guides you through the same calm conflict resolution as a merge. Because many actions have a visible undo, experimenting is safe.
In short
- The stash sets work aside safely without committing.
- apply keeps the entry, pop removes it.
- Give descriptions, or the stack becomes a riddle.
- A stash is local and is not pushed.