Suppose I pull changes from a git repo. Then the author of the repo force pushes to the central repo. Now I can\'t pull since the history is rewritten.
How can I pull th
if have NO local commits, this will recover your checkout from a force push. You will be up to date with the remote branch, and can commit your local work later.
git fetch
git stash
git reset --hard origin/master # destroys your work
git stash pop # restores your work as local changes
git mergetool # fix any conflicts
At this point you have your local changes as they were before. Your checkout is up to date with all the changes on master, or whatever branch you are working from.