Re: Undo a commit that is already pushed to central server and merged to several branches
- From
Matthias Fechner <idefix@fechner.net>
- Date
- Dec 8, 2011, 09:46 UTC
- Message-ID
- <4EE08772.3070703@fechner.net>
- In-Reply-To
- <CALKQrgcQ5jv+oDXxDoTGUhmP-Dg344-oSotb+q-4a3fnEBY1Zw@mail.gmail.com>
Dear Ramkumar and Johan,
Am 07.12.11 17:01, schrieb Johan Herland:
> Use "git revert $commit" to undo the effects of the given $commit. > This must be applied to all affected branches (either by reverting in > the master branch and remerging master to the other branches, or by > using "git revert" in each individual branch).
thanks a lot for your help. The steps I did now was at first undo everything i did locally with: git reset --hard origin/master
Then undo the bad commit: git revert commit-id git commit
Now the bad commit was undone and I merged the master branch in all other branches.
I create a new branch and cherry-picked the bad commit into it so I can correct the problem there and later merge this branch in all the other ones.
Hopefully this short summary will help other users having the same problem.
Bye Matthias
-- "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning." -- Rich Cook