0 votes
1 view
in Devops and Agile by (20k 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 (28.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.

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...