
How to Restore a Single File in a Git Repository
Git Tip:
git checkout allows you to restore a single file to a previous version without affecting the rest of your project. For example: git checkout--.
Full example below:
# View the commit history of a specific file.
git log -- path/to/file
# Restore a specific file to its state