Skip to content

Commit

Permalink
Merge pull request k88hudson#102 from gaetan-petit/patch-1
Browse files Browse the repository at this point in the history
ADD undo rebase/merge
  • Loading branch information
RichardLitt authored Jan 9, 2017
2 parents c89b20a + 5bad85a commit 1cb8a57
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ For clarity's sake all examples in this document use a customized bash prompt in
- [I accidentally deleted my branch](#i-accidentally-deleted-my-branch)
- [I want to delete a branch](#i-want-to-delete-a-branch)
- [Rebasing and Merging](#rebasing-and-merging)
- [I want to undo rebase/merge](#undo-rebase)
- [I rebased, but I don't want to force push.](#i-rebased-but-i-dont-want-to-force-push)
- [I need to combine commits](#i-need-to-combine-commits)
- [Safe merging strategy](#safe-merging-strategy)
Expand Down Expand Up @@ -597,6 +598,15 @@ To delete a local branch:

## Rebasing and Merging

<a name="undo-rebase">
### I want to undo rebase/merge

You may have merged or rebased your current branch with a wrong branch, or you can't figure it out or finish the rebase/merge process. Git saves the original HEAD pointer in a variable called ORIG_HEAD before doing dangerous operations, so it is simple to recover your branch at the state before the rebase/merge.

```sh
(my-branch)$ git reset --hard ORIG_HEAD
```

<a name="force-push-rebase"></a>
### I rebased, but I don't want to force push.

Expand Down

0 comments on commit 1cb8a57

Please sign in to comment.