threads / discuss / 29036

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

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

## tl;dr

One message between Nov 28, 2011 and Nov 28, 2011.

replies: 0people: 1as markdown or json

Ævar Arnfjörð Bjarmason· Nov 28, 2011, 15:46 UTC · lore
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.

← back to recent threads