I'm trying to do the following thing in git:

  1. Go back a few commits (master branch)
  2. Create a new branch
  3. Restore the latest commit on the master branch (go forward)

The order is not important, it could be done like:

  1. Create a new branch and switch to it
  2. Go back a few commits (erase them from the branch history)

How can I do this?

link|improve this question

feedback

1 Answer

up vote 5 down vote accepted

I'm not sure i understand. What's wrong with:

git branch newbranch $ID_OF_BRANCH_POINT

?

link|improve this answer
Nothing, it's actually exactly what I was looking for, I just didn't know it was there. Thanks. – Felix Jul 13 '11 at 11:52
Aha! Glad to be of assistance. – Tom Anderson Jul 13 '11 at 12:25
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.