4

I have two branches:

develop
myFeature

I have made a single commit incorrectly while on develop and should have been on myFeature.

The commit has not been pushed yet.

How can i move this commit from develop and onto myFeature?

Marty Wallace
  • 34,046
  • 53
  • 137
  • 200
  • If it was the last commit made to `develop`, you could just do a soft reset on your head back one commit (while `develop` is checked out), which removes the commit from `develop` but keeps the edits in your local workspace. Then you can checkout `myFeature` (assuming no conflicts will arise), and commit/push the local workspace edits to the feature branch from there. – ajp15243 Sep 04 '13 at 17:00

1 Answers1

11
git checkout myFeature
git cherry-pick develop
git checkout -B develop develop~
jthill
  • 55,082
  • 5
  • 77
  • 137