• 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 a custom software development company co-founded by full-stack .NET Software developer Alex Shapovalov who lives in Mississauga, ON and provides software development services in Mississauga and GTA.

Contact Information

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