How to revert file to previous commit version in Git

When you modified, but did not commit 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


Social media


Latest Tweets