How to show a file in specific branch

This is part of the Semicolon&Sons Code Diary - consisting of lessons learned on the job. You're in the git category.

Last Updated: 2024-11-21

How to show a file as it was during a specific commit or on a specific branch?

# Specific branches
git show master:index.html
git show development:index.html

# Specific commit
git show asfa798:index.html