← all articles

Git stash lost: how to find changes you thought were gone

You stashed your work, and now it isn't there.

Run git stash list first. If the entry is gone because you dropped or cleared it, Git's own docs give a git fsck --unreachable command that lists stash entries still in your repository. If untracked files are missing, a plain git stash never saved them.

Lost code you saw but can't find? Download ReMynd

Is the stash really gone?

If git stash lost my changes is your search, check the stash list before anything else.

The git-stash docs say stash@{0} is the latest entry, stash@{1} is the one before, and so on. This page reflects those docs as checked on December 4, 2026. The site says the git-stash manual was last updated in Git 2.56.0, listed with the date September 28, 2026. Git's source code is mirrored at github.com/git/git.

  1. List them. Run git stash list.
  2. Look inside one. Run git stash show -p stash@{1} to see its diff.
  3. Apply it. Run git stash apply stash@{1}. Apply keeps the entry in the list, so you can try again.

If a git stash pop stopped on a conflict, your entry is still there. Git's docs say applying the state can fail with conflicts, and in this case it is not removed from the stash list.

Diagram titled Git stash lost: Check in this order. Stop at the first step that shows your changes. Left card, highlighted in claret, Still in the stash list: git stash list; git stash show -p stash@{1}; git stash apply stash@{1}. Right card, Dropped or cleared: git fsck --unreachable; look for WIP merge commits; cleared entries may be pruned. Bottom bar: Untracked files? Only stashed with -u or -a.

Check the stash list first, then look for dropped entries. Illustration by ReMynd.

How to recover a dropped or cleared stash

To recover dropped git stash entries, use the fsck command from Git's own docs. Git's docs are direct about this. If you mistakenly drop or clear stash entries, they cannot be recovered through the normal safety mechanisms.

The same page then gives a command to list stash entries that are still in your repository but not reachable any more:

git fsck --unreachable | grep commit | cut -d\ -f3 | xargs git log --merges --no-walk --grep=WIP

The command filters for merge commits with a WIP message. When you find the one you want, run git stash apply with its commit hash.

The git-fsck docs also list a --lost-found option that writes dangling objects out so you can look at them.

Why git stash lost untracked files

A git stash lost untracked files because a plain git stash doesn't take new files Git isn't tracking yet.

Git's docs say that with -u (or --include-untracked), all untracked files are also stashed and then cleaned up with git clean. With -a (--all), ignored files are stashed too. So if your git stash lost untracked files, they were never in that entry, and they are still wherever you left them unless something else removed them.

To check what an entry holds, git stash show -u includes the untracked files in the diff.

How long Git keeps lost changes

To git recover lost changes, don't wait. Git doesn't keep unreachable work forever. The stash docs say cleared entries are subject to pruning and may be impossible to recover.

The git-reflog docs say reflogs record when the tips of branches and other references were updated in the local repository. By default, unreachable entries expire after 30 days and other entries after 90 days. The site lists that manual as last changed in Git 2.51.1, dated October 15, 2025.

The git-gc docs say git gc --prune removes loose objects older than 2 weeks by default. The site lists the git-gc manual as last changed in November 2025, in Git 2.52.0. In our view, run the fsck command the same day you notice a stash is missing.

A simple decision path

The table below maps five cases to what Git's docs say.

What happenedWhat to runWhat Git's docs say
Entry is lower in the listgit stash list, then git stash apply stash@{1}stash@{0} is the latest entry
Pop hit a conflictgit stash listthe entry is not removed from the stash list
Entry dropped or clearedgit fsck --unreachable commandcannot be recovered through the normal safety mechanisms
Untracked files missingnothing to recover from the stashonly stashed with -u or -a
Lost to a resetgit reflogreflogs record when the tips of branches were updated
  1. In the list? Run git stash list and apply the entry you want.
  2. Dropped or cleared? Run the git fsck --unreachable command above.
  3. Untracked files missing? They were only stashed with -u or -a.
  4. Lost to a reset, not a stash? Check git reflog for the commit you were on.

If you saved the file in Microsoft's VS Code, its local history in the Timeline view can also hold a copy, depending on your settings, since Microsoft's docs say a new entry is added every time you save an editor. See VS Code local history for the steps.

If an AI agent wiped your changes, see Codex undo changes and Cursor restore checkpoint. For a broader file problem, read how to recover deleted files on a Mac.

Where ReMynd fits

ReMynd is a desktop app that gives your computer local photographic memory, for you and your AI agents. It locally captures your screen history and keeps the searchable index on your computer.

On a Mac, ReMynd needs screen recording permission, which Apple's guide puts in System Settings under Privacy & Security, Screen & System Audio Recording.

So if code was on your screen in the window you were working in, starting from install, you can search for a word from it, even when Git has nothing left. It doesn't restore files and doesn't read your repository.

There's more for engineering teams on ReMynd for engineers. For commands that scrolled away in Apple's Terminal, read how to see terminal history on a Mac.

Your screen history is stored on your computer by default, and nothing is uploaded to us unless you turn on optional cloud sync. You can pause capture or block any app or site. That's how ReMynd's own pages put it.

Honest limits

  • ReMynd can't restore a stash, a commit or a file.
  • ReMynd captures only what is on your screen, starting from install. It can't recover code you saw before that.
  • Text recognition reads the window you're working in, so code in a window behind it won't be searchable by its words.
  • On a Mac, ReMynd needs Apple silicon and macOS 15 or later. ReMynd also runs on Windows 11 (x64 or arm64).

The short version

Run git stash list, then git stash show -p and git stash apply on the entry you want. If you dropped or cleared it, use the git fsck --unreachable command from Git's docs before pruning removes it. Untracked files are only stashed with -u or -a. For agents losing your work, giving an AI coding agent memory of your actual work is the next read.

Want the code you read to stay findable? Download ReMynd

common questions

Where did my git stash go? +
Run git stash list first. Git's docs say stash@{0} is the latest entry and stash@{1} is the one before. If a pop hit conflicts, the docs say the entry is not removed from the stash list.
Can I recover a dropped git stash? +
Sometimes. Git's docs say dropped or cleared entries cannot be recovered through the normal safety mechanisms, but they give a git fsck --unreachable command that lists stash entries still in your repository.
Why did git stash lose my untracked files? +
A plain git stash leaves untracked files out. Git's docs say that with -u (--include-untracked), all untracked files are also stashed and then cleaned up with git clean.
How long can I recover lost git changes? +
Git's reflog docs say unreachable reflog entries expire after 30 days by default and other entries after 90 days. The stash docs say cleared entries are subject to pruning and may be impossible to recover, so look soon.
Can ReMynd recover a git stash? +
No. ReMynd doesn't read your repository or restore files. If the code was on your screen in the window you were working in, starting from install, you can search ReMynd for a word from it.