In git, how do I remove a commit from a branch but keep that commit in a separate branch?
In git, how do I remove a commit from a branch but keep that commit in a separate branch? I have a DEV branch with a history looking like this (with each list item being a separate commit): Suppose I want to "delete" feature 3 from this branch, but I don't want to lose the code in this feature so I want to put it in it's own separate branch. Basically, from the dev branch above, I want to end up with two branches looking like this: DEV BRANCH : NEW BRANCH : Any ideas how I can achieve this in git? Possible duplicate of Move some commits to another branch – phd Jul 2 at 8:51 3 Answers 3 Create a new branch from feature3 . Then reset feature3 from the dev branch. However, if you have pushed these commits you will need to use revert ...