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

Cancelling certain commits

From
BBBahadir Balban <bahadir.balban@gmail.com>
Date
Jan 16, 2006, 13:57 UTC
Message-ID
<7ac1e90c0601160557r78599886nca9be9b6672a1bd7@mail.gmail.com>
Hi,

If I'm not happy with the changes I made in certain commits during development, how do I cancel those commits and remove them from git records most cleanly?

For example if I did commits 1 to 10, and want to get rid of commit 3 and 7, such that, the other commits are irrelevant to changes made in 3 and 7, but may involve changes in the same file as 3 and 7 changed, how do I handle it?

Furthermore, how would I handle it if there was a commit 4, that depended partially on commit 3? (For example if it uses a type that was changed in commit 3?) Would I hand-edit commit 4 to fix it?

Many thanks, Bahadir

Next: Andreas Ericsson
Message 1 of 4 in “Cancelling certain commits”
  1. Bahadir BalbanJan 16, 2006
  2. Andreas EricssonJan 16, 2006
  3. Junio C HamanoJan 16, 2006
  4. Andreas EricssonJan 17, 2006

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.