Drupal 7 Commerce Stock Decrease stock when reverting cancel the order
It can be done using hook_default_rules_configuration().
Below is my code:

&lt;?php
/**
 * implement hook_default_rules_configuration().
*/
function phponwebsites_default_rules_configuration(){
$rules = array();
$rules_export = '{ "phponwebsites_rules_decrement_stock_revert_cancel" : {
            "LABEL" : "Stock: decrease when revert canceling the order process (cloned)",
            "PLUGIN" : "reaction rule",
            "OWNER" : "rules",
            "TAGS" : [ "stock_control" ],
            "REQUIRES" : [ "rules", "commerce_ss", "entity" ],
            "ON" : { "commerce_order_update" : [] },
            "IF" : [
              { "data_is" : { "data" : [ "commerce-order:status" ],
                  "op" : "IN",
                  "value" : { "value" : {
                      "pending" : "pending",
                      "processing" : "processing",
                      "completed" : "completed"
                    }
                  }
                }
              },
              { "data_is" : {
                  "data" : [ "commerce-order-unchanged:status" ], "value" : "canceled"
                }
              }
            ],
            "DO" : [
              { "LOOP" : {
                  "USING" : { "list" : [ "commerce-order:commerce-line-items" ] },
                  "ITEM" : { "list_item" : "Current list item" },
                  "DO" : [
                    { "commerce_ss_decrease_by_line_item" : { "commerce_line_item" : [ "list-item" ] } }
                  ]
                }
              }
            ]
          }
        }';
   $rules['phponwebsites_rules_decrement_stock_revert_cancel'] = rules_import($rules_export);
 return $rules;
}
?&gt;