After decades of experience, my normal practice is to make regular multi-generational backups of the entire disk (usually compressed). When something like this goes wrong, I can revert to the last known-good image and go from there. It saves a lot of time and trouble.