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:53 UTC
Message-ID
<51419b2c0803191953y7842ddf8l7a6de37226cb12e2@mail.gmail.com>
In-Reply-To
<20080318230441.GA664@arctrix.com>
On Tue, Mar 18, 2008 at 5:04 PM, Neil Schemenauer <nas@arctrix.com> wrote:
Show 7 quoted lines
> 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
or
  git show HEAD:<path> > <path>
Previous: Jakub NarebskiNext: Elijah Newren
Message 4 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.