How to force pull and overwrite local files in git
- First, update all origin/
refs to latest:
git fetch --all
- Backup your current branch (e.g. master):
git branch backup-master
- Jump to the latest commit on origin/
and checkout those files:
git reset --hard origin/master
References: stackoverflow