I have a repository in Git. I made a branch, then did some changes both to the master and to the branch.
Then, tens of commits later, I realized the branch is in muc
Make sure everything is pushed up to your remote repository (GitHub):
git checkout main
Overwrite "main" with "better_branch":
git reset --hard better_branch
Force the push to your remote repository:
git push -f origin main