{"thread":{"id":"13693","subject":"Reverting to old commit","startedAt":"2008-05-27T17:50:31Z","lastAt":"2008-05-27T23:00:11Z","messageCount":8,"participants":["Marcus","Jakub Narebski","Sverre Rabbelier","Dirk Süsserott","Paolo Bonzini","Brandon Casey","Robin Rosenberg"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"77874","messageId":"8345bd80805271050q7412917bt292a276fbbe6aed3@mail.gmail.com","threadId":"13693","inReplyTo":null,"subject":"Reverting to old commit","fromName":"Marcus","fromEmail":"prima@wordit.com","sentAt":"2008-05-27T17:50:31Z","receivedAt":"2008-05-27T17:50:31Z","isPatch":false,"sender":{"key":"prima@wordit.com","avatar":null},"body":"Newbie question: What's the simplest way to find an old commit and revert?\n\nSay you have a version from yesterday which worked and today's\nexperiments failed, so you want to go back to that working version.\nUnfortunately, it's not tagged. Instead you need to actually view the\ncode to identify the version you want. I thought maybe gitk might\nhelp, but I can't find my way with gitk. I hoped you could browse\nrevisions easier in a GUI and tell gitk or git-gui to revert?\n\nThanks,\n\nMarcus\n"},{"id":"77878","messageId":"m3bq2r39gh.fsf@localhost.localdomain","threadId":"13693","inReplyTo":"8345bd80805271050q7412917bt292a276fbbe6aed3@mail.gmail.com","subject":"Re: Reverting to old commit","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2008-05-27T18:09:40Z","receivedAt":"2008-05-27T18:09:40Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Marcus <prima@wordit.com> writes:\n\n> Newbie question: What's the simplest way to find an old commit and revert?\n> \n> Say you have a version from yesterday which worked and today's\n> experiments failed, so you want to go back to that working version.\n> Unfortunately, it's not tagged. Instead you need to actually view the\n> code to identify the version you want. I thought maybe gitk might\n> help, but I can't find my way with gitk. I hoped you could browse\n> revisions easier in a GUI and tell gitk or git-gui to revert?\n\nErrr... isn't it what git-bisect is for?\n\nIf it is not, viewing git-log, or git-reflog output should help...\n-- \nJakub Narebski\nPoland\nShadeHawk on #git\n"},{"id":"77879","messageId":"bd6139dc0805271232x53e91c0fx699c1ea0769e50ec@mail.gmail.com","threadId":"13693","inReplyTo":"8345bd80805271050q7412917bt292a276fbbe6aed3@mail.gmail.com","subject":"Re: Reverting to old commit","fromName":"Sverre Rabbelier","fromEmail":"alturin@gmail.com","sentAt":"2008-05-27T19:32:13Z","receivedAt":"2008-05-27T19:32:13Z","isPatch":false,"sender":{"key":"alturin@gmail.com","avatar":null},"body":"On Tue, May 27, 2008 at 7:50 PM, Marcus <prima@wordit.com> wrote:\n> Newbie question: What's the simplest way to find an old commit and revert?\n>\n> Say you have a version from yesterday which worked and today's\n> experiments failed, so you want to go back to that working version.\n> Unfortunately, it's not tagged. Instead you need to actually view the\n> code to identify the version you want. I thought maybe gitk might\n> help, but I can't find my way with gitk. I hoped you could browse\n> revisions easier in a GUI and tell gitk or git-gui to revert?\n\nHave a look at the reflog (git reflog) perhaps combined with \"git log\n-p\" which will show the changes each commit introduced as well.\n\n-- \nCheers,\n\nSverre Rabbelier\n"},{"id":"77881","messageId":"483C68E5.1040408@dirk.my1.cc","threadId":"13693","inReplyTo":"8345bd80805271050q7412917bt292a276fbbe6aed3@mail.gmail.com","subject":"Re: Reverting to old commit","fromName":"Dirk Süsserott","fromEmail":"newsletter@dirk.my1.cc","sentAt":"2008-05-27T20:02:45Z","receivedAt":"2008-05-27T20:02:45Z","isPatch":false,"sender":{"key":"newsletter@dirk.my1.cc","avatar":null},"body":"Marcus schrieb:\n> Newbie question: What's the simplest way to find an old commit and revert?\n>\n> Say you have a version from yesterday which worked and today's\n> experiments failed, so you want to go back to that working version.\n> Unfortunately, it's not tagged. Instead you need to actually view the\n> code to identify the version you want. I thought maybe gitk might\n> help, but I can't find my way with gitk. I hoped you could browse\n> revisions easier in a GUI and tell gitk or git-gui to revert?\n>\n> Thanks,\n>\n> Marcus\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n>\n>   \nProbably I misunderstood, but: do you *know* which version worked\nwell? I.e. when you start gitk, can you point to the working\ncommit and are just wondering how to revert to that one?\n\nThen gitk's \"reset ... branch to here\" could help you. Right-click\nthe desired commit and reset the branch.\n\nThere's no need to have a tag for this. You can even create a\ntag afterwards for any commit you like. It's just an alias for\nthe commit id (sha1).\n\nIf you cannot identify the working commit, then please forget\nmy answer and follow the \"git bisect\" proposals.\n"},{"id":"77883","messageId":"483C6C44.1010304@gnu.org","threadId":"13693","inReplyTo":"483C68E5.1040408@dirk.my1.cc","subject":"Re: Reverting to old commit","fromName":"Paolo Bonzini","fromEmail":"bonzini@gnu.org","sentAt":"2008-05-27T20:17:08Z","receivedAt":"2008-05-27T20:17:08Z","isPatch":false,"sender":{"key":"bonzini@gnu.org","avatar":"https://avatars.githubusercontent.com/u/42082?v=4"},"body":"\n> Then gitk's \"reset ... branch to here\" could help you. Right-click\n> the desired commit and reset the branch.\n\nDON'T do this though if you have published the branch somewhere.\n\nDo \"git-revert -n\" on all the commits after the buggy one in that case, \nstarting from the last, then \"git commit\".\n\nPaolo\n"},{"id":"77894","messageId":"200805272241.04884.robin.rosenberg.lists@dewire.com","threadId":"13693","inReplyTo":"8345bd80805271050q7412917bt292a276fbbe6aed3@mail.gmail.com","subject":"Re: Reverting to old commit","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg.lists@dewire.com","sentAt":"2008-05-27T20:41:04Z","receivedAt":"2008-05-27T20:41:04Z","isPatch":false,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"tisdagen den 27 maj 2008 19.50.31 skrev Marcus:\n> Newbie question: What's the simplest way to find an old commit and revert?\n> \n> Say you have a version from yesterday which worked and today's\n> experiments failed, so you want to go back to that working version.\n> Unfortunately, it's not tagged. Instead you need to actually view the\n> code to identify the version you want. I thought maybe gitk might\n> help, but I can't find my way with gitk. I hoped you could browse\n> revisions easier in a GUI and tell gitk or git-gui to revert?\n\nIf you know a line of code that you know or suspect is wrong, you\ncan find the commit that introduced the version using git blame. \n\n-- robin\n"},{"id":"77889","messageId":"6IRlPIxadiyIIPsto-MFx6wInl0VvCRxVSaI3-OglmCjLt5obfbiww@cipher.nrlssc.navy.mil","threadId":"13693","inReplyTo":"m3bq2r39gh.fsf@localhost.localdomain","subject":"Re: Reverting to old commit","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2008-05-27T20:43:52Z","receivedAt":"2008-05-27T20:43:52Z","isPatch":false,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"Jakub Narebski wrote:\n> Marcus <prima@wordit.com> writes:\n> \n>> Newbie question: What's the simplest way to find an old commit and revert?\n>>\n>> Say you have a version from yesterday which worked and today's\n>> experiments failed, so you want to go back to that working version.\n>> Unfortunately, it's not tagged. Instead you need to actually view the\n>> code to identify the version you want. I thought maybe gitk might\n>> help, but I can't find my way with gitk. I hoped you could browse\n>> revisions easier in a GUI and tell gitk or git-gui to revert?\n> \n> Errr... isn't it what git-bisect is for?\n> \n> If it is not, viewing git-log, or git-reflog output should help...\n\nShouldn't we be encouraging the use of 'git log -g' rather than 'git reflog'?\ngit-reflog seems more like plumbing than porcelain to me.\n\n-brandon\n"},{"id":"77901","messageId":"bd6139dc0805271600k6968b6c7j9075bb8aeffe9863@mail.gmail.com","threadId":"13693","inReplyTo":"6IRlPIxadiyIIPsto-MFx6wInl0VvCRxVSaI3-OglmCjLt5obfbiww@cipher.nrlssc.navy.mil","subject":"Re: Reverting to old commit","fromName":"Sverre Rabbelier","fromEmail":"alturin@gmail.com","sentAt":"2008-05-27T23:00:11Z","receivedAt":"2008-05-27T23:00:11Z","isPatch":false,"sender":{"key":"alturin@gmail.com","avatar":null},"body":"On Tue, May 27, 2008 at 10:43 PM, Brandon Casey <casey@nrlssc.navy.mil> wrote:\n\n> Shouldn't we be encouraging the use of 'git log -g' rather than 'git reflog'?\n> git-reflog seems more like plumbing than porcelain to me.\n\nI had no idea, but then again, the man pages don't mention whether\nsomething is plumbing or porcelain anywhere... But I guess 'git log\n-g' is easier to use (since it supplies the user with most of git\nlog's features) than git reflog. I was introduced to reflog by someone\nadvising me to use it, so I was merely \"passing on\" that advice,\nunknowing of 'git log -g' :).\n\n-- \nCheers,\n\nSverre Rabbelier\n"}]}