Skip to content

Instantly share code, notes, and snippets.

@motowilliams
Created April 30, 2013 22:22
Show Gist options
  • Save motowilliams/5492400 to your computer and use it in GitHub Desktop.
Save motowilliams/5492400 to your computer and use it in GitHub Desktop.
Created branch from feature01 instead of master
sitting on feature01 - all commited, no changes
started to work another problem
better create a branch for this
- git branch -b feature02
whoops sitting on feature02 with some new changes that I really wanted based on master instead of feature01
... something-something profit ...
@dahlbyk
Copy link

dahlbyk commented Apr 30, 2013

Assuming you're on feature02 and you've commited (or stashed) all WIP, this will replay all commits since feature01 starting from `master instead:

git rebase --onto master feature01

@dahlbyk
Copy link

dahlbyk commented Apr 30, 2013

Or if you haven't done any work at all on feature02, you can just git reset --hard master to move the branch pointer (and reset the working copy) to match master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment