From: Junio C Hamano Date: Wed, 14 Feb 2007 21:25:58 GMT Subject: Re: Stupid question on getting branch from yesterday Message-ID: <7vire4mnx5.fsf@assigned-by-dhcp.cox.net> In-Reply-To: Linus Torvalds writes: > So depending on what your situation is, this sequence actually works: > > # > # Create and check out a "fixes" branch that has the > # known-broken commit as its head commit > # > git checkout -b fixes > > .. edit edit edit to fix the broken commit .. > > # > # Then, just _replace_ the broken commit with the fixed state > # by doing a "git commit --amend" > # > git commit -a --amend > > # > # ok, now the "fixed-branch" is in good shape, but we > # want to re-surrect our original 'master' branch WITH the > # fix, and based on the fixed branch, so we rebase the > # master branch# _onto_ the fixed state in "fixes", with > # the broken commit (that we do _not_ want to include) as > # the base. > # > git rebase --onto fixes master > > Somebody else should verify that "git rebase" thing. Looks fine.