How to force pull and overwrite local files in git

#git #cli

  1. First, update all origin/ refs to latest:
git fetch --all
  1. Backup your current branch (e.g. master):
git branch backup-master
  1. Jump to the latest commit on origin/ and checkout those files:
git reset --hard origin/master

References: stackoverflow