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 this and the other 250+ tutorials on Simple Dev, sign up for a 10-day free trial.