Interview Prep/Git & GitHub/Lost Work, HEAD and History Problems

`git stash` says `No local changes to save` even though files changed.

BeginnerTroubleshootingLost Work, HEAD and History Problems
Answer

Likely causes → Changes are only untracked or ignored files (stash skips them by default), or you are in a different directory or repo from where you edited.

Diagnose → git status --short --ignored and git rev-parse --show-toplevel.

Fix → git stash push -u includes untracked files; -a also includes ignored ones. Confirm with git stash list.

Prevent → Use -u when you have new files.

All Git & GitHub questions Roadmap: Git & GitHub

More on Lost Work, HEAD and History Problems