• Home /
  • Blog /
  • How to revert file to previous commit version in Git
Git Tutorials

How to revert file to previous commit version in Git

When you modified, but did not commit the file and want to revert your changes, you can use git checkout command providing file name or wildcards to revert, for example, all files of the same type.

How to revert single file in git

git checkout path-to-file

How to revert group of files in git

# git checkout wildcards git checkout *.cs

Comments

Yaplex - Freelance developer - white logo on black background

Yaplex is an IT Consulting and .NET development company co-founded by freelance developer Alex Shapovalov who lives in Canada and provides software development services in Canada, USA and all over the world.

Contact Information

Toronto, Canada
Phone: +1 647 328 3809
Email: alex@yaplex.com