git revert one file to previous commit code example
Example 1: How can I reset or revert a file to a specific revision?
git reset <commit hash> <filename>
Example 2: how to commit file to previous commit in git
$ git add new-file
$ git commit --amend
Example 3: git reset specific file
git checkout c5f567 -- file1/to/restore file2/to/restore
Example 4: git revert commit for single file
git checkout <commit_hash> path/to/file