Commanding Chaos for Coworking, Open Source and Creative Communities

files

git: revert (reset) a single file

Wed, 08/15/2012 - 11:48 -- rprice

If you have an uncommitted change (its only in your working copy) that you wish to revert (in SVN terms) to the copy in your latest commit, do the following:

git checkout filename

This will checkout the file from HEAD, overwriting your change.

The rest of the Internet will tell you to use git reset --hard, but this resets all uncommitted changes you’ve made in your working copy. Type this with care.

files
tips
howto
revision
git
Subscribe to RSS - files