git completely reset branch to origin code example Example: revert to master origin branch git git checkout mybranch git reset --hard origin/mybranch