git completely replaces the code of one branch with the code of another branch

The code of the master branch is completely covered by the code of the dev branch:

git checkout master
git reset --hard dev
git push origin master --force

Guess you like

Origin blog.csdn.net/xiamoziqian/article/details/122305161