My recommendation for expediency's sake would be to remove the template from the nodes and re-apply it to the nodes. Once inheritance is broken at the application level, the only way to re-inherit the settings back from the template is my editing the assigned application. For 12 applications across 1500 nodes (18,000 applications) this isn't a reasonable task to perform manually. Alternatively you may want to consider restoring your database back prior to when the changes were made. Unfortunately changing this via the database as you've discovered is not a simple task as you've already discovered. It is indeed possible, though I would not recommend it. If you'd like to attempt it anyway though I strongly suggest backing up your database beforehand. The SQL contained in the reports below should get you pointed in the right direction with inheritance. Instead of credentials you're concerned with thresholds, but the same basic principles still apply.
APM Component Monitors that are not Inheriting from their Original Template
APM Component Monitors Whose Credentials are not Inherited from the Original Template