How to Revert a Single File to a Previous Commit
You’ve accidentally broken a file and need to restore it from an earlier commit without touching anything else in your repository. Here’s how. Restore a file to a specific commit To restore my_file.name to its state at a specific commit: git checkout commit_sha1 my_file.name Replace commit_sha1 with the actual commit hash. You can find it…
