force git pull overwrite

C++
git fetch --all
git reset --hard origin/mastergit reset --hard origin/master
# if working with newer repos where 'master' is now 'main'
git fetch --all
git reset --hard origin/main 
Source

Also in C++: