git replace with origin branch

C++
git reset --hard origin/<branch-name>

Source

Also in C++: