Skip to content

Instantly share code, notes, and snippets.

@jclosure
Created January 29, 2013 08:21
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 jclosure/4662652 to your computer and use it in GitHub Desktop.
Save jclosure/4662652 to your computer and use it in GitHub Desktop.
Revert source in git repo
Setting your branch to exactly match the remote branch can be done in two steps:
git fetch origin
git reset --hard origin/master
If you want to save your current branch's state before doing this (just in case), you can do:
git commit -a -m "Saving my work, just in case"
git branch my-saved-work
Now your work is saved on the branch "my-saved-work" in case you decide you want it back (or want to look at it later or diff it against your updated branch).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment