Git could-not-restore-untracked-files-from-stash Stash application failed while copying the stash's untracked files back out.

dev@local: ~/project — git
dev@local~/project$git status
error: could not restore untracked files from stash
Diagnostics Translation
Stash application failed while copying the stash's untracked files back out.
waiting for resolution...
MediumVersion Control System

Reviewed for reference consistency: August 11, 2026

Code is Safe

SECURE

Git has paused the operation to protect your code. No data has been lost or corrupted.

What To Know

The tracked half of a stash application and its untracked-file restoration came apart — the untracked content stayed in the stash entry because writing it back hit an obstruction.

Where Did It Fail?

Working Tree
Your local files
add
Staging Index
Prepared changes
commit
Local Repo
Commit history
push/fetch
Remote Server
GitHub/GitLab
Git halted to protect the uncommitted files in your active working directory.

Commands That Trigger This

A file that was untracked at stash time became tracked before the pop
Restoring a stash whose untracked file now collides with an ignored path
A pop with --include-untracked interrupted by a read-only checkout directory

Technical Background

01

Untracked restoration runs as a separate phase after the tracked changes apply. Because the phase uses a temporary index and writes files Git does not otherwise manage, a collision at any path fails the whole phase while the tracked half may already be applied.

02

The stash entry itself is not destroyed by this failure — the untracked content remains stored in the entry's third tree. Removing the obstructing path, or the newly tracked file that took it over, lets a repeated apply place the content.

Underlying Causes

The path now belongs to a tracked file, colliding with the stashed untracked copy
Filesystem permissions or locks blocked writing the restored files
An ignored or excluded path now occupies the target location
The stash's untracked tree references a path that was renamed in the project

Frequently Asked Questions

Yes. They live inside the stash entry until it is dropped; showing the stash with untracked content reveals them.

The stash snapshot remembers paths, not their tracked status; if the same path gained a tracked version meanwhile, the two claims conflict on apply.

Related Git States