Show a file at a specific commit

Print a file's content as it was in an older commit

git show <sha>:path/to/file

tool
git45 commands
tags
git

More git commands

  • git log --oneline --graph --decorate --all | head -40

    Show a compact graph of all branches in the repo (first 40 lines)

  • git log -S 'password' --oneline --all

    Find all commits that added or removed the string 'password'. Hopefully there are none

  • git commit --amend --no-edit

    Add staged changes to the last commit and keep its message

  • git push origin --delete feature/old-branch

    Remove a branch from the remote repository (origin)

  • git clean -fdx

    Delete untracked files and directories, including ignored ones. There is no undo

all 45 git commands