mirror of
https://github.com/k88hudson/git-flight-rules.git
synced 2025-03-10 12:48:43 -03:00
Added explanation of HEAD, kept past example
This commit is contained in:
parent
6a23217314
commit
b0c20c4804
@ -293,23 +293,26 @@ Create the new branch while remaining on 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`:
|
||||
|
||||
```
|
||||
```sh
|
||||
(master)$ git reset --hard a13b85e
|
||||
HEAD is now at a13b85e
|
||||
```
|
||||
|
||||
Checkout the new branch to continue working:
|
||||
|
||||
```
|
||||
```sh
|
||||
(master)$ git checkout new-branch
|
||||
```
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user