To make the main branch exactly like the dev branch by ignoring the changes in the main branch and overwriting it with dev:
git fetch origin
Check out to the main branch:
git checkout main
Reset the main branch to match the dev branch:
git reset --hard origin/dev
Force push the changes to the remote main branch:
git push origin main --force