1
0
mirror of https://github.com/k88hudson/git-flight-rules.git synced 2025-03-10 20:58:39 -03:00

Merge pull request #60 from RichardLitt/feature/arialdomartini

`git reset --hard master~1` rather than `git reset --hard a13b85e`
This commit is contained in:
Richard Littauer 2015-05-19 14:15:27 +07:00
commit aeaa38e922

View File

@ -293,18 +293,26 @@ Create the new branch while remaining on master:
(master)$ (master)$
``` ```
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. `git push` will make sure that this change is reflected on your remote. Reset the branch master to the previous commit:
```sh
(master)$ git reset --hard HEAD^
```
`HEAD^` is short for `HEAD^1`. You can reset further through the generations by specifying which `HEAD` to set to.
Alternatively, if you don't want to use `HEAD^`, 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. `git push` will make sure that this change is reflected on your remote.
For example, if the hash of the commit that your master branch is supposed to be at is `a13b85e`: For example, if the hash of the commit that your master branch is supposed to be at is `a13b85e`:
``` ```sh
(master)$ git reset --hard a13b85e (master)$ git reset --hard a13b85e
HEAD is now at a13b85e HEAD is now at a13b85e
``` ```
Checkout the new branch to continue working: Checkout the new branch to continue working:
``` ```sh
(master)$ git checkout new-branch (master)$ git checkout new-branch
``` ```