How to revert changes in file in GIT?

You have edited one file in GIT version control system and you want to reset (revert) changes in this file. How can you do that?

Everything is simple: use checkout — in the command line. For instance:
git checkout -- path/to/file/my_changed_file.txt

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *