Let’s say that in our Git repository, we worked on branch master for a while. Then, most of us started working on coolfeature branch, while a few developers continued on master.
Now, the developers who worked on master have lost interest, and what they developed since we forked isn’t very important. But we’d like the main development branch to be called master again. Conceptually, we’d basically like the tree to look something like this:
*--master--X ----master
\ /
--coolfeature--
What’s the easiest way to achieve this? We really don’t want to try and merge coolfeature, and we’re happy for the commit marked X to be totally meaningless.
Perform a force push with the new master branch.
Other people fetch the code, and perform a reset