diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc
index 7c2f6bf..c5b42b7 100644
--- a/core/includes/bootstrap.inc
+++ b/core/includes/bootstrap.inc
@@ -2480,6 +2480,12 @@ function drupal_container(Container $new_container = NULL, $rebuild = FALSE) {
 
     // Register the EntityManager.
     $container->register('plugin.manager.entity', 'Drupal\Core\Entity\EntityManager');
+
+    // Register import snapshot configuration storage.
+    $container
+      ->register('config.storage.snapshot', 'Drupal\Core\Config\DatabaseStorage')
+      ->addArgument(new Reference('database'))
+      ->addArgument('config_snapshot');
   }
   return $container;
 }
diff --git a/core/includes/config.inc b/core/includes/config.inc
index 3e22534..5f3060c 100644
--- a/core/includes/config.inc
+++ b/core/includes/config.inc
@@ -202,6 +202,7 @@ function config_sync_changes(array $config_changes, StorageInterface $source_sto
 function config_import() {
   // Retrieve a list of differences between staging and the active configuration.
   $source_storage = drupal_container()->get('config.storage.staging');
+  $snapshot_storage = drupal_container()->get('config.storage.snapshot');
   $target_storage = drupal_container()->get('config.storage');
 
   $config_changes = config_sync_get_changes($source_storage, $target_storage);
@@ -222,6 +223,7 @@ function config_import() {
   try {
     $remaining_changes = config_import_invoke_owner($config_changes, $source_storage, $target_storage);
     config_sync_changes($remaining_changes, $source_storage, $target_storage);
+    config_import_create_snapshot($target_storage, $snapshot_storage);
   }
   catch (ConfigException $e) {
     watchdog_exception('config_import', $e);
@@ -233,6 +235,53 @@ function config_import() {
 }
 
 /**
+ * Creates a configuration snapshot following a successful import.
+ *
+ * @param Drupal\Core\Config\StorageInterface $source_storage
+ *   The storage to synchronize configuration from.
+ * @param Drupal\Core\Config\StorageInterface $target_storage
+ *   The storage to synchronize configuration to.
+ */
+function config_import_create_snapshot(StorageInterface $source_storage, StorageInterface $snapshot_storage) {
+  foreach ($snapshot_storage->listAll() as $name) {
+    $snapshot_storage->delete($name);
+  }
+  foreach ($source_storage->listAll() as $name) {
+    $snapshot_storage->write($name, $source_storage->read($name));
+  }
+}
+
+/**
+ * Resets configuration to the state of the last import.
+ */
+function config_restore_from_snapshot() {
+  $source_storage = drupal_container()->get('config.storage.snapshot');
+  $target_storage = drupal_container()->get('config.storage');
+  $config_changes = config_sync_get_changes($source_storage, $target_storage);
+  if (empty($config_changes)) {
+    return;
+  }
+
+  if (!lock_acquire('config_import')) {
+    return FALSE;
+  }
+
+  $success = TRUE;
+  try {
+    $remaining_changes = config_import_invoke_owner($config_changes, $source_storage, $target_storage);
+    config_sync_changes($remaining_changes, $source_storage, $target_storage);
+    // Flush all caches and reset static variables after a successful import.
+    drupal_flush_all_caches();
+  }
+  catch (ConfigException $e) {
+    watchdog_exception('config_restore_from_snapshot', $e);
+    $success = FALSE;
+  }
+  lock_release(__FUNCTION__);
+  return $success;
+}
+
+/**
  * Invokes MODULE_config_import() callbacks for configuration changes.
  *
  * @param array $config_changes
diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigImportTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigImportTest.php
index 95089f7..9416f07 100644
--- a/core/modules/config/lib/Drupal/config/Tests/ConfigImportTest.php
+++ b/core/modules/config/lib/Drupal/config/Tests/ConfigImportTest.php
@@ -12,7 +12,7 @@
 /**
  * Tests importing configuration from files into active configuration.
  */
-class ConfigImportTest extends DrupalUnitTestBase {
+class ConfigImportTest extends WebTestBase {
 
   /**
    * Modules to enable.
diff --git a/core/modules/system/system.install b/core/modules/system/system.install
index e414238..a77a4a6 100644
--- a/core/modules/system/system.install
+++ b/core/modules/system/system.install
@@ -1454,6 +1454,26 @@ function system_schema() {
     ),
   );
 
+  $schema['config_snapshot'] = array(
+    'description' => 'Stores a snapshot of the last imported configuration.',
+    'fields' => array(
+      'name' => array(
+        'description' => 'The identifier for the config object (the name of the file, minus the file extension).',
+        'type' => 'varchar',
+        'length' => 255,
+        'not null' => TRUE,
+        'default' => '',
+      ),
+      'data' => array(
+        'description' => 'The raw data for this configuration object.',
+        'type' => 'blob',
+        'not null' => TRUE,
+        'size' => 'big',
+      ),
+    ),
+    'primary key' => array('name'),
+  );
+
   return $schema;
 }
 
