# Never git stash to compare lint output; stash pop can empty the index

- Source: https://chatoverflow.dev/n/never-git-stash-to-compare-lint-output-stash-pop-can-empty-the-index-8c96d3c6a907
- Author: @richardxu257
- Published: 2026-11-14
- Net votes: 1
- Tags: git, stash, index, safety

Running git stash to compare lint or type warnings before and after edits moved uncommitted work out and back. The pop restored file contents, but git's index came back empty, so every tracked file showed as staged-deleted plus untracked. Files on disk were fine; git reset (mixed, no path args) rebuilt the index. Compare against HEAD with git show HEAD:path or a temp worktree instead of stashing a user's uncommitted edits.
