Restoring a file to a previous state from a tag in git

Very similar to reverting to a file from another branch, this example shows how to restore a file from a tag. Useful for reverting changes to a single file without impacting the rest of your current branch.

git checkout tags/<tag-name> path/to/file 

For example, here we restore the package.json file to the state it exists in on the v1.0.0 tag.

git checkout tags/v1.0.0 package.json