• 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
Yaplex - Freelance developer - white logo on black background

Yaplex ® is a custom software development company located in Mississauga, Ontario. Yaplex was founded in 2013 and provides website development, mobile development, and custom .NET software development services.

Contact Information

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