From: Alex Riesen <raa.lkml@gmail.com>
To: git@vger.kernel.org
Cc: Nikodemus Siivola <nikodemus@random-state.net>,
martin f krafft <madduck@madduck.net>
Subject: Re: Restoring files from old commits
Date: Sat, 14 Jul 2007 16:32:33 +0200 [thread overview]
Message-ID: <20070714143233.GC2544@steel.home> (raw)
In-Reply-To: <20070714123754.GA29622@piper.oerlikon.madduck.net>
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. On can use
$ git ls-tree -r -z <tree-ish> -- <path> | git update-index -z --index-info
$ git ls-tree -r --name-only -z <tree-ish> -- <path> | 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.
next prev parent reply other threads:[~2007-07-14 14:32 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-14 12:09 Restoring files from old commits Nikodemus Siivola
2007-07-14 12:37 ` martin f krafft
2007-07-14 14:32 ` Alex Riesen [this message]
2007-07-14 18:50 ` Junio C Hamano
2007-07-15 8:41 ` Alex Riesen
2007-08-15 17:22 ` Nikodemus Siivola
2007-08-15 17:28 ` Salikh Zakirov
2007-08-15 18:27 ` Uwe Kleine-König
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070714143233.GC2544@steel.home \
--to=raa.lkml@gmail.com \
--cc=git@vger.kernel.org \
--cc=madduck@madduck.net \
--cc=nikodemus@random-state.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).