4

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.

Any of you knows how can I create the branch with all my previews commits?

I'll really appreciate your help

user2924482
  • 7,520
  • 20
  • 78
  • 152

1 Answers1

8

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]

Pietro Nadalini
  • 1,547
  • 3
  • 12
  • 26
tehp
  • 3,824
  • 1
  • 23
  • 29