tags:

views:

32

answers:

1

Suppose I git clone a repository. Then edit a file A and delete a file B. How can I restore my working copy to the original status?

Something similar to svn up.

+3  A: 
git reset --hard HEAD

is the command that will fully reset your working directory to what was in the most recent commit of the current branch.

If you only need to reset a single file without modifying anything else, git checkout -- fileA.txt will revert only that file (regardless of whether it has been just edited or fully deleted).

Mark Rushakoff