Index: trunk/tools/repair_bad_instance
===================================================================
--- trunk/tools/repair_bad_instance	(revision 33036)
+++ trunk/tools/repair_bad_instance	(revision 33041)
@@ -74,9 +74,13 @@
 }
 
+my $fixed = 0;
 if ($good_instance) {
     foreach my $bad (@bad_instances) {
         my $cmd =  "cp   $good_instance $bad";
         print "    $cmd\n";
-        system $cmd if $go;
+        if ($go) {
+            system $cmd;
+            $fixed = 1;
+        }
     }
 } else {
@@ -84,5 +88,14 @@
     my $cmd = "regtool -updateprocessedimfile -set_ignored -exp_id $exp_id -class_id $class_id\n";
     print "$cmd\n";
-    system $cmd if $go;
+    if ($go) {
+        $fixed = 1;
+        system $cmd;
+    }
+}
+
+if ($fixed) {
+    my $cmd =  "chiptool -revertprocessedimfile -exp_id $exp_id";
+    print "$cmd\n";
+    system $cmd;
 }
 
