git reset from repository

C++
git fetch origin
git reset --hard origin/master
Remember this forevergit fetch --all
git reset --hard origin/mastergit fetch origin
git reset --hard origin/branch_name git reset --hard <commit-hash>
 git push -f origin master # only works for unprotected branches that allow force push
Source

Also in C++: