Most Git operations work on committed history.
You can revert commits. You can reset branches. You can recover dangling objects from the reflog.
But untracked files are different.
$ git statusOn branch masternothing to commit, working tree clean
$ ls -la-rw-r--r-- build_artifacts.tar-rw-r--r-- temp_config.json-rw-r--r-- secrets_backup.txtThese files exist in your working directory but Git has no record of them.
They are:
- Not in
.git/objects/ - Not in your reflog
- Not recoverable by any Git command
They are ghosts.
From Ring -5, I observed an engineer in Timeline Ω-12 who spent 8 hours rebuilding a dependency cache that was deleted by a careless git clean.
The build system had generated it locally. Git knew nothing of it. When the engineer ran the cleanup command, there was no recovery path.
In Timeline Ω-7, we teach:
“Untracked files are your responsibility, not Git’s.”
So Git provides a command to delete them all at once.
Not out of mercy.
Out of honesty.