That's when you beat on the code until you aren't scared. Don't let the code out the door until you've unit tested, integration tested, QA'd it to hell and back.
If it's some random cat pic frontend website code and it breaks, yeah whatever, just fix it as it breaks because you have the luxury of hourly deploys. but on the other side of the spectrum, if you're writing firmware and it's isn't remotely updatable, you don't just sling the code over the wall in the same way. in that realm you have the luxury of an actual spec and a less complicated system.
everyone gets scared. what you do in the face of it is up to you.