How do I reset or revert a file to a specific revision?

To revert a file to a specific revision checkout at your desired commit using Commit ID use git checkout commitSHA

Assuming the hash of the commit  is 329ba0dc6a The format of the git command will look like following.

git checkout 329ba0dc6a -- newfile.php someotherfile.php

In this case, the change a revert you need to commit your changes. Use git commit -m "commit message" to commit you latest change then use git push to push your changes .


Tags:

git

Share:

Related posts