Re: Restoring files from old commits
Alex Riesen <raa.lkml@gmail.com> writes:
Show 13 quoted lines
> martin f krafft, Sat, Jul 14, 2007 14:37:54 +0200:
>> also sprach Nikodemus Siivola <nikodemus@random-state.net> [2007.07.14.1409 +0200]:
>> > What is the recommended way to restore individual files
>> > (or directories) in the working tree to the content they
>> > had in a given commit?
>>
>> As per my comment on IRC, I think
>>
>> git checkout <tree-ish> <path>
>>
>> is the way.
>
> It does not work for directories, though.
Are you sure about that? I just did this in my git.git workspace:
$ mv Documentation Documentation-
$ git checkout HEAD Documentation/
$ diff -r Documentation- Documentation