Skip to content

Instantly share code, notes, and snippets.

@grumpyshoe
Created January 11, 2017 20:03
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 grumpyshoe/548045ee22e937e40db1b266babd6e2f to your computer and use it in GitHub Desktop.
Save grumpyshoe/548045ee22e937e40db1b266babd6e2f to your computer and use it in GitHub Desktop.
reset git to a previous branch
Example of how to reset a master branch to a specific commit (doen't matter which branch of)
git checkout master
git reset --hard <newBaseCommitId>
git push -f origin master
git merge <speceficCommitId>
git push origin master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment