{"thread":{"id":"25206","subject":"Reverting a specific commit","startedAt":"2010-09-23T07:13:43Z","lastAt":"2010-09-23T09:05:23Z","messageCount":5,"participants":["milindkanchan","John Tapsell","Pascal Obry"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"151345","messageId":"1285226023268-5561992.post@n2.nabble.com","threadId":"25206","inReplyTo":null,"subject":"Reverting a specific commit","fromName":"milindkanchan","fromEmail":"milindkanchan@gmail.com","sentAt":"2010-09-23T07:13:43Z","receivedAt":"2010-09-23T07:13:43Z","isPatch":false,"sender":{"key":"milindkanchan@gmail.com","avatar":null},"body":"\nHi All,\n\nI am using git for code management.\n\nI have some query regarding reverting the commit in git.\n\nCan we revert a specific commit in git ?\n\nEg. One of our X developer has committed the code in master branch last\nweek, after which there were several commits to master branch, now there was\nan issue with the code committed by X developer and now I need to\nrevert/discard just his commit keeping the other commits done after him as\nintact.\n\nCan anybody give a solution for this with all the commands.\n\nThanks & Regard\nM.K\n\n-- \nView this message in context: http://git.661346.n2.nabble.com/Reverting-a-specific-commit-tp5561992p5561992.html\nSent from the git mailing list archive at Nabble.com.\n"},{"id":"151346","messageId":"AANLkTikB2A99zXvp8kyajkT63y3HuPMKyTgDg+HJUCLN@mail.gmail.com","threadId":"25206","inReplyTo":"1285226023268-5561992.post@n2.nabble.com","subject":"Re: Reverting a specific commit","fromName":"John Tapsell","fromEmail":"johnflux@gmail.com","sentAt":"2010-09-23T07:17:34Z","receivedAt":"2010-09-23T07:17:34Z","isPatch":false,"sender":{"key":"johnflux@gmail.com","avatar":"https://gravatar.com/avatar/25f70d4c0f96396b84a2e34bcd9bdc233462c7b4be29b5fdca8266fc53f30b0c?d=mp&s=160"},"body":"On 23 September 2010 08:13, milindkanchan <milindkanchan@gmail.com> wrote:\n>\n> Hi All,\n>\n> I am using git for code management.\n>\n> I have some query regarding reverting the commit in git.\n>\n> Can we revert a specific commit in git ?\n\nTo make a new commit to undo a bad commit:\n\ngit revert SHA\n\nwhere SHA is that long string of numbers and letters associated with\neach commit.  do \"git log\" to find out what the SHA is.\n\nJohn\n"},{"id":"151347","messageId":"AANLkTi=8gfw3FbReaCmf=tVnu2CEajCLmW-7whn27cya@mail.gmail.com","threadId":"25206","inReplyTo":"1285226023268-5561992.post@n2.nabble.com","subject":"Re: Reverting a specific commit","fromName":"Pascal Obry","fromEmail":"pascal@obry.net","sentAt":"2010-09-23T07:17:42Z","receivedAt":"2010-09-23T07:17:42Z","isPatch":false,"sender":{"key":"pascal@obry.net","avatar":"https://avatars.githubusercontent.com/u/467069?v=4"},"body":"On Thu, Sep 23, 2010 at 9:13 AM, milindkanchan <milindkanchan@gmail.com> wrote:\n> Can we revert a specific commit in git ?\n\n   $ git revert <sha1>\n\nfor more information:\n\n   $ git revert --help\n\nPascal.\n\n-- \n\n--|------------------------------------------------------\n--| Pascal Obry                           Team-Ada Member\n--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE\n--|------------------------------------------------------\n--|              http://www.obry.net\n--| \"The best way to travel is by means of imagination\"\n--|\n--| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595\n"},{"id":"151349","messageId":"1285228861635-5562096.post@n2.nabble.com","threadId":"25206","inReplyTo":"AANLkTi=8gfw3FbReaCmf=tVnu2CEajCLmW-7whn27cya@mail.gmail.com","subject":"Re: Reverting a specific commit","fromName":"milindkanchan","fromEmail":"milindkanchan@gmail.com","sentAt":"2010-09-23T08:01:01Z","receivedAt":"2010-09-23T08:01:01Z","isPatch":false,"sender":{"key":"milindkanchan@gmail.com","avatar":null},"body":"\nBut will it affect the commits done after that\n-- \nView this message in context: http://git.661346.n2.nabble.com/Reverting-a-specific-commit-tp5561992p5562096.html\nSent from the git mailing list archive at Nabble.com.\n"},{"id":"151350","messageId":"AANLkTinogubdAZkA272ryG9qr9D=T5H9PwHPth3ThoQ9@mail.gmail.com","threadId":"25206","inReplyTo":"1285228861635-5562096.post@n2.nabble.com","subject":"Re: Reverting a specific commit","fromName":"Pascal Obry","fromEmail":"pascal@obry.net","sentAt":"2010-09-23T09:05:23Z","receivedAt":"2010-09-23T09:05:23Z","isPatch":false,"sender":{"key":"pascal@obry.net","avatar":"https://avatars.githubusercontent.com/u/467069?v=4"},"body":"On Thu, Sep 23, 2010 at 10:01 AM, milindkanchan <milindkanchan@gmail.com> wrote:\n>\n> But will it affect the commits done after that\n\nNo. It is a revert. I will create a new commit that revert the work\ndone for the given commit.\n\nPascal.\n\n-- \n\n--|------------------------------------------------------\n--| Pascal Obry                           Team-Ada Member\n--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE\n--|------------------------------------------------------\n--|              http://www.obry.net\n--| \"The best way to travel is by means of imagination\"\n--|\n--| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595\n"}]}