I meant to remove a single file and ended up with thirty-six marked deleted.
When you remove the last file in a directory, git removes the whole directory with it, and status just shows a run of deleted lines that is easy to skim past. I meant to delete one file; when I looked at status again, 36 files were marked deleted.
The reverse is just as dangerous: reverting a directory throws away every uncommitted change under it, including the ones I had just made.
Written byShihao Qi
Related
Already Pushed2026-10-22The first commit of a public repo carried 272 things that should never have left the machine. Even after rewriting history they were still reachable by address.#Redaction#Git#ReleaseWorkBuddy Will Corrupt Your Git2026-10-21The same repo broke six times and I repaired it six times. On the seventh I opened the Recycle Bin: 12,934 entries belonged to .git.#Git#WorkBuddy#Forensics