{"thread":{"id":"12458","subject":"[RFC] git reset --recover","startedAt":"2008-03-03T14:59:14Z","lastAt":"2008-03-04T08:22:40Z","messageCount":7,"participants":["Ping Yin","Santi Béjar","Charles Bailey","Jay Soffian"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"70788","messageId":"46dff0320803030659j2fa0325lf9c88b915ddb70da@mail.gmail.com","threadId":"12458","inReplyTo":null,"subject":"[RFC] git reset --recover","fromName":"Ping Yin","fromEmail":"pkufranky@gmail.com","sentAt":"2008-03-03T14:59:14Z","receivedAt":"2008-03-03T14:59:14Z","isPatch":false,"sender":{"key":"pkufranky@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5346?v=4"},"body":"Today i use git reset carelessly and lose all my changes!\n\nTo remind other people not do the same wrong thing, i share my\nexperience and propose a new option to avoid this happens again.\n------------------------------------\nfoo\n   .git\n    bar\n        file1\n        file2\n------------------------------------\n\nIn the direcotry structure above, i want to make bar as a repository\n(which hasn't yet been tracked by foo repository). I should have done\nthis as follows\n\n-------------------------------------------\ncd bar\ngit init\ngit add\n------------------------------------------\n\nbut i fogot to type \"git init\" which results that file1 and file2 are\nadded to index of foo repository. I tried to revert the operation\nusing \"git reset\". And the tragedy happened at that time because i\nmade so fatal  a mistake that i typed \"git reset --hard\". And i lost\nall my files in bar dir!\n\nSo, can we introduce a --recover option for \"git reset\" to save the\nfoolish or careless people like me?\n\n-- \nPing Yin\n"},{"id":"70790","messageId":"8aa486160803030713r7bdcf825sf994cbb20f096ccd@mail.gmail.com","threadId":"12458","inReplyTo":"46dff0320803030659j2fa0325lf9c88b915ddb70da@mail.gmail.com","subject":"Re: [RFC] git reset --recover","fromName":"Santi Béjar","fromEmail":"sbejar@gmail.com","sentAt":"2008-03-03T15:13:06Z","receivedAt":"2008-03-03T15:13:06Z","isPatch":false,"sender":{"key":"santi@agolina.net","avatar":null},"body":"On Mon, Mar 3, 2008 at 3:59 PM, Ping Yin <pkufranky@gmail.com> wrote:\n> Today i use git reset carelessly and lose all my changes!\n>\n>  To remind other people not do the same wrong thing, i share my\n>  experience and propose a new option to avoid this happens again.\n>  ------------------------------------\n>  foo\n>    .git\n>     bar\n>         file1\n>         file2\n>  ------------------------------------\n>\n>  In the direcotry structure above, i want to make bar as a repository\n>  (which hasn't yet been tracked by foo repository). I should have done\n>  this as follows\n>\n>  -------------------------------------------\n>  cd bar\n>  git init\n>  git add\n>  ------------------------------------------\n>\n>  but i fogot to type \"git init\" which results that file1 and file2 are\n>  added to index of foo repository. I tried to revert the operation\n>  using \"git reset\". And the tragedy happened at that time because i\n>  made so fatal  a mistake that i typed \"git reset --hard\". And i lost\n>  all my files in bar dir!\n\n\"git reset\" was sufficient.\n\n>\n>  So, can we introduce a --recover option for \"git reset\" to save the\n>  foolish or careless people like me?\n\nAnother possibility would be to not delete a file that is absent in\nboth the old and new HEAD, even if it was in the index.\n\nSanti\n"},{"id":"70798","messageId":"46dff0320803030847t42583badw1f5163d600a6fafb@mail.gmail.com","threadId":"12458","inReplyTo":"8aa486160803030713r7bdcf825sf994cbb20f096ccd@mail.gmail.com","subject":"Re: [RFC] git reset --recover","fromName":"Ping Yin","fromEmail":"pkufranky@gmail.com","sentAt":"2008-03-03T16:47:08Z","receivedAt":"2008-03-03T16:47:08Z","isPatch":false,"sender":{"key":"pkufranky@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5346?v=4"},"body":"On Mon, Mar 3, 2008 at 11:13 PM, Santi Béjar <sbejar@gmail.com> wrote:\n> On Mon, Mar 3, 2008 at 3:59 PM, Ping Yin <pkufranky@gmail.com> wrote:\n>  > Today i use git reset carelessly and lose all my changes!\n>  >\n\n>  >\n>  >  but i fogot to type \"git init\" which results that file1 and file2 are\n>  >  added to index of foo repository. I tried to revert the operation\n>  >  using \"git reset\". And the tragedy happened at that time because i\n>  >  made so fatal  a mistake that i typed \"git reset --hard\". And i lost\n>  >  all my files in bar dir!\n>\n>  \"git reset\" was sufficient.\n>\nI know about this, but i was just too careless.\n>\n>  >\n>  >  So, can we introduce a --recover option for \"git reset\" to save the\n>  >  foolish or careless people like me?\n>\n>  Another possibility would be to not delete a file that is absent in\n>  both the old and new HEAD, even if it was in the index.\n>\nSounds interesting.\n>  Santi\n>\n\n\n\n-- \nPing Yin\n"},{"id":"70802","messageId":"20080303170242.GA30361@hashpling.org","threadId":"12458","inReplyTo":"46dff0320803030659j2fa0325lf9c88b915ddb70da@mail.gmail.com","subject":"Re: [RFC] git reset --recover","fromName":"Charles Bailey","fromEmail":"charles@hashpling.org","sentAt":"2008-03-03T17:02:43Z","receivedAt":"2008-03-03T17:02:43Z","isPatch":false,"sender":{"key":"charles@hashpling.org","avatar":"https://avatars.githubusercontent.com/u/1668475?v=4"},"body":"On Mon, Mar 03, 2008 at 10:59:14PM +0800, Ping Yin wrote:\n> \n> but i fogot to type \"git init\" which results that file1 and file2 are\n> added to index of foo repository. I tried to revert the operation\n> using \"git reset\". And the tragedy happened at that time because i\n> made so fatal  a mistake that i typed \"git reset --hard\". And i lost\n> all my files in bar dir!\n\nIf they've been added to the index then the objects should be in your\ngit repository, it's just that it may be hard to find them.\n\nDoes 'git fsck' report some dangling blobs?  If so (some of) them\nshould be the content of your missing files.\n\n"},{"id":"70891","messageId":"46dff0320803032121v54612b40ke953348e86daf1f@mail.gmail.com","threadId":"12458","inReplyTo":"20080303170242.GA30361@hashpling.org","subject":"Re: [RFC] git reset --recover","fromName":"Ping Yin","fromEmail":"pkufranky@gmail.com","sentAt":"2008-03-04T05:21:04Z","receivedAt":"2008-03-04T05:21:04Z","isPatch":false,"sender":{"key":"pkufranky@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5346?v=4"},"body":"On Tue, Mar 4, 2008 at 1:02 AM, Charles Bailey <charles@hashpling.org> wrote:\n> On Mon, Mar 03, 2008 at 10:59:14PM +0800, Ping Yin wrote:\n>  >\n>\n>  If they've been added to the index then the objects should be in your\n>  git repository, it's just that it may be hard to find them.\n>\n>  Does 'git fsck' report some dangling blobs?  If so (some of) them\n>  should be the content of your missing files.\n>\nGood news. So can \"--recover\" help me find the lost blobs?\n\n\n-- \nPing Yin\n"},{"id":"70899","messageId":"76718490803032342k18f05d4dte76aacd9292a1233@mail.gmail.com","threadId":"12458","inReplyTo":"46dff0320803032121v54612b40ke953348e86daf1f@mail.gmail.com","subject":"Re: [RFC] git reset --recover","fromName":"Jay Soffian","fromEmail":"jaysoffian@gmail.com","sentAt":"2008-03-04T07:42:13Z","receivedAt":"2008-03-04T07:42:13Z","isPatch":false,"sender":{"key":"jaysoffian@gmail.com","avatar":"https://avatars.githubusercontent.com/u/155970?v=4"},"body":"On Tue, Mar 4, 2008 at 12:21 AM, Ping Yin <pkufranky@gmail.com> wrote:\n> On Tue, Mar 4, 2008 at 1:02 AM, Charles Bailey <charles@hashpling.org> wrote:\n>  >\n>  >  Does 'git fsck' report some dangling blobs?  If so (some of) them\n>  >  should be the content of your missing files.\n>  >\n>  Good news. So can \"--recover\" help me find the lost blobs?\n\ngit fsck --lost-found. Look under .git/lost-found/other for your blobs.\nAnything that's not 41 bytes is a file.\n\nj.\n"},{"id":"70903","messageId":"46dff0320803040022r6babc3d2n745bc8a08b8bf197@mail.gmail.com","threadId":"12458","inReplyTo":"76718490803032342k18f05d4dte76aacd9292a1233@mail.gmail.com","subject":"Re: [RFC] git reset --recover","fromName":"Ping Yin","fromEmail":"pkufranky@gmail.com","sentAt":"2008-03-04T08:22:40Z","receivedAt":"2008-03-04T08:22:40Z","isPatch":false,"sender":{"key":"pkufranky@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5346?v=4"},"body":"On Tue, Mar 4, 2008 at 3:42 PM, Jay Soffian <jaysoffian@gmail.com> wrote:\n> On Tue, Mar 4, 2008 at 12:21 AM, Ping Yin <pkufranky@gmail.com> wrote:\n>  > On Tue, Mar 4, 2008 at 1:02 AM, Charles Bailey <charles@hashpling.org> wrote:\n>  >  >\n>\n> >  >  Does 'git fsck' report some dangling blobs?  If so (some of) them\n>  >  >  should be the content of your missing files.\n>  >  >\n>  >  Good news. So can \"--recover\" help me find the lost blobs?\n>\n>  git fsck --lost-found. Look under .git/lost-found/other for your blobs.\n>  Anything that's not 41 bytes is a file.\n>\nThanks for pointing me that.\n>  j.\n>\n\n\n\n-- \nPing Yin\n"}]}