At first, I assume that you have no problem deploying any particular branch.
In environments with some semblance of professionalism (and budget), there would be an intermediate environment in which the new code will be deployed before it starts working (in your case, in the repository of a real server). Usually, the production version should always be stable (hint: if it wasn’t the case, you should have noticed it before it ended, and good testing methods would also be useful here)
Now let's assume that you still have to “fix” the master for production, and the usual revert is not enough, one way to do this is:
- Reset - set the desired commit
- Reset (soft) to the head of the wizard (now your working copy will still be from the desired commit)
- Configure the current working copy (i.e.
git add . ) And commit it.
PS: Note that I do not do this often, and I hope that you will not do it, especially on the main
One more warning: this will not take care of database backups, you will need other contingency plans for these
source share