user2924482
user2924482

Reputation: 9120

GIT: Creating new branch with reverted changes

Accidentally I merge branch on my master branch but I had to revert the changes. I want to create a new branch and pick all the changes I had to revert.

How can I create the branch with all my previews commits?

Upvotes: 6

Views: 4621

Answers (1)

tehp
tehp

Reputation: 6394

To create and checks out a new branch:

git checkout -b [name]

To cherry pick a commit onto this new branch:

git cherry-pick [commit hash]

Upvotes: 10

Related Questions