Don’t Panic! Well, panic a little
Once you notice the pipeline is red, do these in this exact order
git revert <your commit hash
All a git revert does is create a new commit that excludes the changes in the breaking commit you’re reverting
git pull -r
If anyone has pushed after you, possibly with your broken code, this will merge theirs into your code and put your revert commit at the top. If no one else pushed, don’t stress
git log
to check the order is right: <Reverted Commit> <Someones Good Commit> <Your Broken Commit>
git push
Remote will now run with your broken code removed but the other peoples code added
Now you need to debug your error and push once you’ve fixed it
git checkout <commit before revert hash>
To get the the point where thing’s broke
- Make your fixes
git push
a new revision, alternatively you fucked up so maybe push to a branch and validate the pipeline is okaygit checkout -b <branch name