{"thread":{"id":"14446","subject":"I want delete fault commit from my git repository","startedAt":"2008-07-14T09:24:00Z","lastAt":"2008-07-14T16:41:26Z","messageCount":2,"participants":["chongyc","Jakub Narebski"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"83244","messageId":"9f01c190-73b6-48b1-88d9-ed67d0945d81@k13g2000hse.googlegroups.com","threadId":"14446","inReplyTo":null,"subject":"I want delete fault commit from my git repository","fromName":"chongyc","fromEmail":"chongyc27@gmail.com","sentAt":"2008-07-14T09:24:00Z","receivedAt":"2008-07-14T09:24:00Z","isPatch":false,"sender":{"key":"chongyc27@gmail.com","avatar":"https://gravatar.com/avatar/2e4e0f376f8474fd86c1466c95384d836fd7ffaef0aa8d0b87188ff8562d6f52?d=mp&s=160"},"body":"I have found buggy commit object which I had committed into  git\nrepository  wrongly\n\nSo I am going to delete it from my git repository\n\nHow to do it ?\n\nplease help me.\n"},{"id":"83273","messageId":"m3wsjos9jm.fsf@localhost.localdomain","threadId":"14446","inReplyTo":"9f01c190-73b6-48b1-88d9-ed67d0945d81@k13g2000hse.googlegroups.com","subject":"Re: I want delete fault commit from my git repository","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2008-07-14T16:41:26Z","receivedAt":"2008-07-14T16:41:26Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"chongyc <chongyc27@gmail.com> writes:\n\n> I have found buggy commit object which I had committed into  git\n> repository  wrongly\n> \n> So I am going to delete it from my git repository\n> \n> How to do it ?\n\nIf it is just created commit (and not yet published), use \n\"git commit --amend\" to correct it, or \"git reset --hard HEAD^\"\nto just drop it.\n\nIf you have published history (somebody is relying on history\ncontaining broken commit) the only way is to add commit reverting\nchanges brought by broken commit using git-revert.\n\nIf you can rewrite history, use \"git rebase --interactive\" and simply\nremove the commit from instructions/series file if the commit you want\nto remove is not too deep in history, or use git-filter-branch if\nbroken commit is somewhere deeper.  See documentation for details.\n\n-- \nJakub Narebski\nPoland\nShadeHawk on #git\n"}]}