Skip to content

Instantly share code, notes, and snippets.

@joechrysler
Last active January 3, 2016 14:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joechrysler/8479938 to your computer and use it in GitHub Desktop.
Save joechrysler/8479938 to your computer and use it in GitHub Desktop.
git checkout -b new_branch # make the new branch so you don't lose commits
git push origin new_branch:new_branch # push your new branch to github so github doesn't lose commits
git checkout master # switch to master so that you're resetting master, not your new branch
git reset --hard cbedd62 # move master back to the last commit it should be on
git checkout master # you should be at the old commit.
git push -f origin master:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment