xxxxxxxxxx
git reset --hard <commit-hash>
git push -f origin master # only works for unprotected branches that allow force push
xxxxxxxxxx
git reset --hard origin/master; git commit -m 'reset to remote';git push --force local dev
xxxxxxxxxx
# local
git reset <commit-hash>
# or
git reset --hard <commit-hash>
# remote
git push -f origin master
# or
git push -f
xxxxxxxxxx
git fetch origin # Fetch the latest changes from the remote repository
git reset --hard origin/<branch-name> # Reset the local branch to match the fetched remote branch