{"thread":{"id":"12531","subject":"Silly revert question workflow...","startedAt":"2008-03-06T06:29:34Z","lastAt":"2008-03-06T06:37:31Z","messageCount":2,"participants":["Gonzalo Garramuño","Mike Hommey"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"71198","messageId":"47CF8F4E.5010809@advancedsl.com.ar","threadId":"12531","inReplyTo":null,"subject":"Silly revert question workflow...","fromName":"Gonzalo Garramuño","fromEmail":"ggarra@advancedsl.com.ar","sentAt":"2008-03-06T06:29:34Z","receivedAt":"2008-03-06T06:29:34Z","isPatch":false,"sender":{"key":"ggarra@advancedsl.com.ar","avatar":null},"body":"\nI'm wondering if there's any easy way to basically \"fix\" the last commit \nfrom the history.  To explain a little bit...\n\nBeing the silly guy I am, one of the very common things I do is that I \nmay be working on two features simultaneously.\nThen one feature is done, I will do a check-in and then seconds later \nI'll realize that I forgot to add, say, another .h file that was also \nmodified and that I thought was not needed for that commit.\nSure enough, without that .h file the tree as checked in is really in an \nuncompilable state.\n\ngit revert allows me to revert the commit and do it again.  But it still \nleaves a commit in the history tree that is uncompilable.\n\nThis also happens to me when I am in a different branch doing fixes and \nI need to quickly go to another branch to do changes there (ie. in the \nsame dir, without cloning), so I end up doing a commit in the fix branch \nof my temporary stuff and then do a co of the stable branch.\nI would like to then later go back to the fixing branch and remove that \ntemporary commit (or ammend it changing all its history).\n\n\n-- \nGonzalo Garramuño\nggarra@advancedsl.com.ar\n\nAMD4400 - ASUS48N-E\nGeForce7300GT\nXubuntu Gutsy\n"},{"id":"71200","messageId":"20080306063731.GA8537@glandium.org","threadId":"12531","inReplyTo":"47CF8F4E.5010809@advancedsl.com.ar","subject":"Re: Silly revert question workflow...","fromName":"Mike Hommey","fromEmail":"mh@glandium.org","sentAt":"2008-03-06T06:37:31Z","receivedAt":"2008-03-06T06:37:31Z","isPatch":false,"sender":{"key":"mh@glandium.org","avatar":"https://avatars.githubusercontent.com/u/1038527?v=4"},"body":"On Thu, Mar 06, 2008 at 03:29:34AM -0300, Gonzalo Garramuño wrote:\n>\n> I'm wondering if there's any easy way to basically \"fix\" the last commit  \n> from the history.  To explain a little bit...\n>\n> Being the silly guy I am, one of the very common things I do is that I  \n> may be working on two features simultaneously.\n> Then one feature is done, I will do a check-in and then seconds later  \n> I'll realize that I forgot to add, say, another .h file that was also  \n> modified and that I thought was not needed for that commit.\n> Sure enough, without that .h file the tree as checked in is really in an  \n> uncompilable state.\n>\n> git revert allows me to revert the commit and do it again.  But it still  \n> leaves a commit in the history tree that is uncompilable.\n\nYou are looking for git commit --amend\n\nMike\n"}]}