One of my teammates mistakenly pushed some commits to our main development branch. We\'re a small, collocated team. Our remote repository is hosted on an inter
May I suggest that this could be considered a duplicate of this answer: Make the current git branch a master branch
Jefromi's excellent solution was:
[git branch better_branch ]
git checkout better_branch
git merge --strategy=ours master # keep the content of this branch, but record a merge
git checkout master
git merge better_branch # fast-forward master up to the merge