--- tags: - git references: - https://stackoverflow.com/questions/7203515/how-to-find-a-deleted-file-in-the-project-commit-history --- Find a (deleted) file in all commits. `g lg --all --full-history -- "**/shell.nix"` or more generally `g lg --all --full-history -- ` then using the SHA `g show -- ` **Epic bonus** Restore the file: `g checkout ^ -- ` the caret (`^`) references one commit before sha, because in sha it is deleted.