Skip to content

Commit

Permalink
I made changes to the wrong branch (k88hudson#202)
Browse files Browse the repository at this point in the history
* I made changes to the wrong branch

* Missed from last commit

* Fixing links

* Making changes

* Another change

* Moving section
  • Loading branch information
NRKirby authored and RichardLitt committed Jan 7, 2018
1 parent be480c4 commit e0513d8
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ For clarity's sake all examples in this document use a customized bash prompt in
- [I want to create a new remote branch from current local one](#i-want-to-create-a-new-remote-branch-from-current-local-one)
- [I want to set a remote branch as the upstream for a local branch](#i-want-to-set-a-remote-branch-as-the-upstream-for-a-local-branch)
- [I want to set my HEAD to track the default remote branch](#i-want-to-set-my-head-to-track-the-default-remote-branch)
- [I made changes on the wrong branch](#i-made-changes-on-the-wrong-branch)
- [Rebasing and Merging](#rebasing-and-merging)
- [I want to undo rebase/merge](#i-want-to-undo-rebasemerge)
- [I rebased, but I don't want to force push](#i-rebased-but-i-dont-want-to-force-push)
Expand Down Expand Up @@ -839,6 +840,16 @@ $ git remote set-head origin --auto
origin/HEAD set to master
```

### I made changes on the wrong branch

You've made uncommitted changes and realise you're on the wrong branch. Stash changes and apply them to the branch you want:

```sh
(wrong_branch)$ git stash
(wrong_branch)$ git checkout <correct_branch>
(correct_branch)$ git stash apply
```

## Rebasing and Merging

<a name="undo-rebase"></a>
Expand Down

0 comments on commit e0513d8

Please sign in to comment.