Re: How to undo git-rm?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Neil Schemenauer <nas@xxxxxxxxxxx> 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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux