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

Git screwup with reset

From
JVjake varghese <jake@orgsync.com>
Date
May 18, 2009, 14:58 UTC
Message-ID
<9D569322-6A7B-4447-962C-0C740945E227@orgsync.com>
Hi All,

I really screwed up. I had about 2 weeks worth of code I was working on that got reset right out before commit.

Here's what happened.
1.  I coded for 2 weeks and didnt commit or add anything (yes, i  
know, real stupid)
2.  I was attempting to commit today and added the files.
3.  I realized a couple of files were added that i didnt want and  
werent being matched to the gitignore because i spelled them wrong.   
I fixed the gitignore file but the files still showed up, Im guessing  
because i used "git add ." before.
4.  Then i ran git reset --hard because i just wanted to undo the  
add.  Clearly this was where everything fell apart.
5.  I lost 2 weeks worth of code.
That's basically how it happened.

When I run git fsck --lost-found i get a whole bunch of dangling objects. If I run git show on those objects it shows me the code that was lost. Anyone know of a way to get this stuff back. I tried rebasing and merging and neither worked.

Thanks in advance,

Jake Varghese OrgSync Inc. 866.ORG.SYNC jake@orgsync.com www.orgsync.com

Next: Shawn O. Pearce
Message 1 of 3 in “Git screwup with reset”
  1. jake vargheseMay 18, 2009
  2. Shawn O. PearceMay 18, 2009
  3. Sverre RabbelierMay 18, 2009

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.