You can split code management into two tasks:
And you do both over a continuous process.
How to increase confidence?
Minimize the ways things can be done
Make those ways obvious
Make sure those ways work
Automate anything you can
Introduce explicit processes for anything you can’t automate
Leave notes for things where you can do neither
Ensure the new code you add is better than the old one (through automation, process, and notes)