Search This Blog

Friday 21 February 2020

Git reset

Overwrite local uncommitted changes from origin
git fetch origin
git reset --hard origin/master

...or on a single line:
sudo git fetch origin && sudo git reset --hard origin/master



OPTIONAL: save current branch state before reset:
git commit -a -m "Safe copy"
git branch aSafeCopy

No comments:

Post a Comment