All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Narebski <jnareb@gmail.com>
To: Neil Schemenauer <nas@arctrix.com>
Cc: git@vger.kernel.org
Subject: Re: How to undo git-rm?
Date: Wed, 19 Mar 2008 17:49:46 -0700 (PDT)	[thread overview]
Message-ID: <m31w66w76k.fsf@localhost.localdomain> (raw)
In-Reply-To: <20080318230441.GA664@arctrix.com>

Neil Schemenauer <nas@arctrix.com> writes:

> Hi,
> 
> This seemingly simple operation has me stumped.  I removed something
> from my try using "git rm" and now I want it back.  With SVN I would
> use "svn cat <path> > <path>".  After some searching around, I
> though git-cat-file would do the trick.  Alas, it appears as though
> it looks up the SHA for the path in the index and so it too fails.

Direct equivalent would be

  $ git show HEAD:<path> > <path>   # from last commit
  $ git show :<path>     > <path>   # from index

but actually you would probably use

  $ git checkout -- <path>

-- 
Jakub Narebski
Poland
ShadeHawk on #git

  parent reply	other threads:[~2008-03-20  0:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-18 23:04 How to undo git-rm? Neil Schemenauer
2008-03-20  0:24 ` Junio C Hamano
2008-03-20  0:49 ` Jakub Narebski [this message]
2008-03-20  2:53 ` Elijah Newren
2008-03-20  2:54   ` Elijah Newren

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=m31w66w76k.fsf@localhost.localdomain \
    --to=jnareb@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=nas@arctrix.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.