# update origin refs
git fetch --all
 
# create a backup branch
git branch backup-main
 
# overwrite from origin
git reset --hard origin/main