Merge pull request #21 from jwhear/master

Use `branch` instead of `checkout -b`
This commit is contained in:
Kate Hudson 2014-08-22 14:55:09 -04:00
commit fc2ec9c64a
1 changed files with 8 additions and 4 deletions

View File

@ -217,12 +217,10 @@ If you need to change all of history, see the man page for 'git filter-branch'
## I committed to master instead of a new branch
Check out a new branch, then return to your master branch
Create the new branch while remaining on master:
```
(master)$ git checkout -b new-branch
(new-branch)$ git checkout master
(master)$
(master)$ git branch new-branch
```
Find out what the commit hash you want to set your master branch to (`git log` should do the trick). Then reset to that hash.
@ -234,6 +232,12 @@ For example, if the hash of the commit that your master branch is supposed to be
HEAD is now at a13b85e
```
Checkout the new branch to continue working:
```
(master)$ git checkout new-branch
```
<a name="cherry-pick"></a>
## I made several commits on a single branch that should be on different branches