Stashes are a way to save your uncommitted changes temporarily without committing them. This is useful when you need to switch branches but have uncommitted work, or when you want to set aside changes temporarily.

A stash takes your uncommitted changes (both staged and unstaged) and saves them as a temporary commit. Your working directory is then cleaned, allowing you to:
You don’t have to stash everything — you can stash only the files you choose.
Only the selected files are moved into the stash; the rest of your changes stay untouched in Local Changes.
The stash dialog offers two options:
| Option | Description |
|---|---|
| Stage new files | Includes new (untracked) files in the stash. Git ignores untracked files by default, so leave this enabled if you want them stashed. |
| Keep changes in working directory | Creates the stash but leaves the changes in Local Changes instead of removing them. Useful for snapshotting your work without interrupting it. When disabled (the default), the changes are removed from the working directory after stashing. |
ugit automatically creates a stash in certain situations:
The Stashes panel shows all saved stashes:
| Field | Description |
|---|---|
| Icon | Stash indicator (🗂️) |
| Message | Your stash description |
| Index | Stash number (stash@{0} is most recent) |
Click on a stash to view its details.
Applying a stash brings back the saved changes but keeps the stash in the list.
Popping applies the most recent stash and removes it from the stash list.
This is the same as:
⚠️ This permanently deletes all stashes.
Stashes can only be deleted one at a time through the UI.
Export a stash’s changes to a .patch file you can share or apply elsewhere.
If the stash also captured untracked files, a second command, Save as Patch (include untracked)…, appears; it adds those files to the patch as new-file diffs. Note that applying such a patch fails if those files already exist in the target working directory.
Patch files can be applied from the repository … menu → Apply Patch…, or with git apply.
feature-branchmain quicklymainfeature-branch| Git Command | Description |
|---|---|
git stash |
Save uncommitted changes |
git stash push -m "message" |
Stash with a message |
git stash push -m "message" -- <files> |
Stash only the selected files |
git stash push ... && git stash apply |
Stash while keeping the changes in the working directory |
git stash list |
List all stashes |
git stash pop |
Apply most recent stash and remove it |
git stash apply |
Apply stash without removing |
git stash drop |
Delete a specific stash |
git stash clear |
Delete all stashes |
git stash show -p --no-include-untracked stash@{n} |
Save a stash as a patch |
git stash show -p --include-untracked stash@{n} |
Save a stash as a patch, including untracked files |
When creating a stash, use a clear message:
Stashes are meant for temporary storage. Commit your changes when you’re ready.
When applying a stash, you may get merge conflicts. Resolve them like regular merge conflicts, then continue.
If a stash won’t apply cleanly:
git stash drop to remove itIf you accidentally drop a stash, you may be able to recover it with:
git fsck --unreachable | grep commit