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

Has someone tried to do "git revert <commit> -- <path>"

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Nov 28, 2011, 15:46 UTC
Message-ID
<CACBZZX6H7g711C9yoi4pv_DWv021P4vfn-CvVYa-7zufqSQeJQ@mail.gmail.com>
Sometimes I want to partially revert a commit, what I'll do is:
    git revert --no-commit <commit> &&
    git reset &&
    git add <paths> &&
    git commit
At which point I'll manually type in the commit window:
    Partially revert "description(<commit>)"
    This partially reverts <commit>. Only <paths> have been reverted.

Has someone tried to patch the revert logic to just support an optional paths parameter, in which case this wouldn't need to be so hard.

Message 1 of 1 in “Has someone tried to do "git revert <commit> -- <path>"”
  1. Ævar Arnfjörð BjarmasonNov 28, 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.