1.//git push to wrong branch
git checkout bug-fix //goto correct branch
git cherry-pick main //last commit of main branch to bug_fix
2.//revert main branch
git checkout main
git reset --hard HEAD~1 //change to prev state.
//git reverse last push
git reset --hard <revision_id_of_last_known_good_commit>
git push --force //prev state will push
//merge conflict
1.git merge --abort
2.Resolve the conflict.
3.Don't forget to add and commit the merge.
4.git pull ,now should work fine