From: Alex Riesen Date: Sat, 14 Jul 2007 14:32:33 GMT Subject: Re: Restoring files from old commits Message-ID: <20070714143233.GC2544@steel.home> In-Reply-To: <20070714123754.GA29622@piper.oerlikon.madduck.net> martin f krafft, Sat, Jul 14, 2007 14:37:54 +0200: > also sprach Nikodemus Siivola [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 > > is the way. It does not work for directories, though. On can use $ git ls-tree -r -z -- | git update-index -z --index-info $ git ls-tree -r --name-only -z -- | git checkout-index -f -z --stdin for a more generic way to do this. P.S. Martin, would you please stop removing people from address lists and stop using that Mail-Followup-To? People miss their mails when they are not addressed to them anymore and you doing exactly that.