As we already know now a days, version controlling are very important and we all do version controlling.

So let say the case where we are working in a different branch and suddenly your master branch got conflict or corrupted.

If there are no options to get the master branch merge than in last case we can do hard merging and make the best branch to master. Below are the commands for hard merging.

Step 1: git checkout master

Step 2: git reset --hard better_branch

Step 3: git push -f origin master

Last Modified: 2 years ago