0 votes
1 view
in Devops and Agile by (14.7k points)

After the last commit, I modified a bunch of files in my working copy, but I want to undo the changes to one of those files, as in reset it to the same state as the most recent commit.

However, I only want to undo the working copy changes of just that one file alone, nothing else with it.

How do I do that?

1 Answer

0 votes
by (20.4k points)
edited by

Use the following command: 

git checkout -- filename

Using '--' is a good practice to avoid the confusion between branch name and filename.

...