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

Re: git-add + git-reset --hard = Arrrggh!

From
Shawn Pearce <spearce@spearce.org>
Date
May 17, 2006, 21:35 UTC
Message-ID
<20060517213516.GA30313@spearce.org>
In-Reply-To
<81b0412b0605170722u15702301p2565e8ac29a5a0da@mail.gmail.com>
Alex Riesen <raa.lkml@gmail.com> wrote:
Show 8 quoted lines
> On 5/17/06, Shawn Pearce <spearce@spearce.org> wrote:
> >All I can say is I'm very happy that update-index does a lot more
> >than just update the index.  I was easily able to find the deleted
> >test by finding the most recently modified object in my .git/objects
> >directory and pulling it back out with git cat-file.  :-)
> >
> 
> Maybe git-lost-found would help here?

Thanks! I did that the hard way with git fsck-objects only to find I actually had a lot of dangling objects. Luckily the most recent one was the one I was looking for so a quick pipe through perl and ls -t found it quite quickly.

What would have really helped me was just using GIT properly rather than slamming something in fast with `git reset --hard`. Somehow that option has become part of my finger feel when using reset and that's just not right. :-)

-- 
Shawn.
Previous: Linus Torvalds
Message 3 of 3 in “git-add + git-reset --hard = Arrrggh!”
  1. Shawn PearceMay 17, 2006
  2. Linus TorvaldsMay 17, 2006
  3. Shawn PearceMay 17, 2006

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.