Topic: Git Basics

Discard changes to file – Git

Preview

To discard changes to a file, enter the following command in your terminal:

git checkout -- file-name

To view the full tutorial, sign up for a free trial on our Sign Up page.