I've got a main branch in my project, which got dirty by some bad commits pushed into it (by merging a side branch into it). Now, in order to restore that main branch fast so others won't get infected, i didn't want to start investigating which commit i can leave and which one is the bad ones. I had a good main branch localy on my pc, which was in the latest version before that bad merge, so what we did is delete the bad remote branch and pushed the local good one to the server.
Except of bad-good practice issues, is there any other problems with the way we solved it?
The answer is "No" since the branch is working fine in your local. By removing the "Bad push" and making the branch just like before the "Bad push" you just did fine.
If something happens just like this again just use the features of Git such as reverse commit git revert
and you can also visit this link for reference
Git command reference