Code Snippet: Revert all overridden views

<?php
$views
= views_get_all_views();
 
foreach (
$views as $view) {
  if (
$view->disabled) continue;
 
  if (
$view->type == t('Overridden')) {
   
$view->delete();
   
views_object_cache_clear('view', $view->name);
  }
}
?>

Tags: