Skip to content

Instantly share code, notes, and snippets.

@joechrysler
Last active January 3, 2016 14:59

Revisions

  1. joechrysler revised this gist Jan 17, 2014. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -2,4 +2,5 @@ git checkout -b new_branch # make the new branch so you don't
    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 checkout master # you should be at the old commit.
    git push -f origin master:master
  2. joechrysler created this gist Jan 17, 2014.
    5 changes: 5 additions & 0 deletions gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    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.