Skip to content

Instantly share code, notes, and snippets.

@panoskouf
Last active June 14, 2021 08:46
Show Gist options
  • Save panoskouf/b2f8e71ce2f01cb1559b2a0ed9913af3 to your computer and use it in GitHub Desktop.
Save panoskouf/b2f8e71ce2f01cb1559b2a0ed9913af3 to your computer and use it in GitHub Desktop.
destroy local changes of branch and make it same as remote
git fetch origin
git reset --hard origin/master
# Update @2020 (if you have main branch instead of master in remote repo)
git fetch origin
git reset --hard origin/main
# 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment