git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: How to undo git-rm?

From
Elijah Newren <newren@gmail.com>
Date
Mar 20, 2008, 02:54 UTC
Message-ID
<51419b2c0803191954q1811c351jc65ff1ac541f07a2@mail.gmail.com>
In-Reply-To
<51419b2c0803191953y7842ddf8l7a6de37226cb12e2@mail.gmail.com>
On Wed, Mar 19, 2008 at 8:53 PM, Elijah Newren <newren@gmail.com> wrote:
Show 11 quoted lines
> On Tue, Mar 18, 2008 at 5:04 PM, Neil Schemenauer <nas@arctrix.com> wrote:
>  > 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.
>
>  Try
>   git checkout HEAD eg
doh, that should be
  git checkout HEAD <path>
of course.
>  or
>   git show HEAD:<path> > <path>
Previous: Elijah Newren
Message 5 of 5 in “How to undo git-rm?”
  1. Neil SchemenauerMar 18, 2008
  2. Junio C HamanoMar 20, 2008
  3. Jakub NarebskiMar 20, 2008
  4. Elijah NewrenMar 20, 2008
  5. Elijah NewrenMar 20, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.