Last Updated: February 25, 2016
· devatotech

Git reset local to remote

Sometimes you make a mess and need a hard reset to remote:

git fetch origin
git reset --hard origin/master
git clean -f -d

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
Filed Under