Git Revert? Reset? No, Checkout!

It took me longer then I expected it to, to find out how to revert a single file using git. Git revert is not it, that’s for creating a commit to undo the changes of another commit. Maybe git reset? No, that resets the current HEAD, not a specific file, it would seem. Turns out it’s just a simple re-checkout of the offending file. D’oh.

  • Emma Gahan

    Geeze Richard i could have told you that!

  • Tilo

    thanks for the tip! :) indeed not obvious, when coming from SVN or other VC-tools..

  • Marina

    This tip came in useful! Thanks!