[Drupal] How to revert feature during deployment

| | 1 min read

You can revert features in deployment phase by just adding an update hook and calling features_revert() in install file. Read on to know the code changes to add.

After exporting the features you will need to implement hook_update_N() in .install file of your module and call features_revert()
with the name of feature you want to revert.

function my_module_update_7001() {
 features_revert_module('site_settings');
}

Here "site_settings" is the machine name of feature which needs to revert.

Once you deploy the features to live site you would just need to run update.php to have the new changes reflected in site.

Hope this helps.