For this question you could use:
git fetch --all
git reset --hard origin/master
OR If you are on some other branch:
git reset --hard origin/<branch_name>
These commands will reset the master branch to what you just fetched. The --hard option changes all the files in your working tree to match the files in origin/master.
If you need to maintain current changes you could use:
git checkout master
git branch new-branch-to-save-current-commits
git fetch --all
git reset --hard origin/master
With this, your local changes will be saved in a new branch named new-branch-to-save-current-commits.
If the changes are uncommitted then you could use:
however, uncommitted changes will be lost. Make sure to stash and commit anything you need using:
git stash
and if you need to retrieve these changes then you could use:
git stash pop