git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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
Previous: Johan Herland
Message 6 of 6 in “Undo a commit that is already pushed to central server and merged to several branches”
  1. Matthias FechnerDec 7, 2011
  2. Ramkumar RamachandraDec 7, 2011
  3. Matthias FechnerDec 7, 2011
  4. Ramkumar RamachandraDec 7, 2011
  5. Johan HerlandDec 7, 2011
  6. Matthias FechnerDec 8, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.