1

In git, how to I revert everything in a specific directory to how it was at a given SHA, leaving changes elsewhere in the repo untouched?

Ben Aston
  • 49,455
  • 61
  • 188
  • 322
  • http://stackoverflow.com/questions/6119036/how-to-revert-a-folder-to-a-particular-commit-by-creating-a-patch – Ben Aston Aug 27 '14 at 19:20

1 Answers1

2

It sounds like you want:

git checkout REVISION -- path/to/revert

Just to play it safe, save off your changes elsewhere before doing this. There's no way back if you have local modifications.

John Szakmeister
  • 41,719
  • 9
  • 84
  • 75