git reset --mixed SHA_TO_BACKTRACK_TO

will also do it. :)

On Tue, Jul 24, 2012 at 11:28 PM, Solomon Boulos <[email protected]> wrote:
> Boo to gitk and mouse usage ;)
>
> Reset is the right way to get to "just before commit" (rebase edit comes 
> "after" commit), and then you want git add --patch (-i for git add is 
> terrible).
>
> ?> git rebase -i [origin/master or whatever]
>    -- Choose 'e' for edit on the commit you want to break up
> ?> git reset HEAD^ (though I prefer --hard and redo em)
> ?> git add --patch [file/to/break/up.cc]
> ?> git commit -c ORIG_HEAD [assuming you want to reuse that message]
> ?> git rebase --continue
>
>
> On Jul 24, 2012, at 10:39 PM, Jeremy Selan wrote:
>
>> Yes, checkout the latest commit, then launch gitk --all.  right click
>> on the commit you want to backtrack to (this may be one or more), and
>> then when it asks you for a reset type do a 'mixed' reset. (I think
>> thats what its called).  Then youll have all the changes unstaged, and
>> you can manually re-add/commit them as needed in batches you find
>> suitable.
>>
>> http://andy.delcambre.com/2008/03/12/git-reset-in-depth.html
>>
>> -- Jeremy
>>
>> On Tue, Jul 24, 2012 at 10:33 PM, Larry Gritz <[email protected]> wrote:
>>> I know how to use "git rebase -i" to squash/fix to combine multiple commits 
>>> into a single one.
>>>
>>> I want to do the reverse.
>>>
>>> Is there a way to "split" a commit by file?  Let's say I have a single 
>>> commit that changes foo.cpp and bar.cpp.  Is there any simple way to split 
>>> it retroactively into one commit for foo.cpp and a second commit for 
>>> bar.cpp?  (Say, after doing the atomic commit, I realize that they are 
>>> solving separate bugs and I wish to split them into two different reviews, 
>>> or only merge one into the main branch, or something like that.)
>>>
>>> --
>>> Larry Gritz
>>> [email protected]
>>>
>>>
>>> _______________________________________________
>>> Oiio-dev mailing list
>>> [email protected]
>>> http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org
>> _______________________________________________
>> Oiio-dev mailing list
>> [email protected]
>> http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org
>
> _______________________________________________
> Oiio-dev mailing list
> [email protected]
> http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org
_______________________________________________
Oiio-dev mailing list
[email protected]
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org

Reply via email to