This document describes how to restore (or undelete) a deleted dataset in
BigQuery.
You can restore a dataset to recover it to the state that it was in when it was
deleted. You can only restore datasets that are within your
time travel window.
This recovery includes all of the objects that were contained in the dataset,
the dataset properties, and the security settings. For resources that are not
recovered, see
Limitations.
For information about restoring a deleted table or snapshot, see the following
resources:
The following is a list of limitations related to restoring a dataset:
Restored datasets might reference security principals that no longer exist.
References to a deleted dataset in linked datasets aren't restored when
you perform this action. Subscribers must subscribe again to manually restore
the links.
Business tags aren't restored when you perform this action.
You cannot restore a logical view directly. For more information, see Restore a view.
A BigQuery CDC-enabled table
doesn't resume background apply jobs when restored as part of an
undeleted dataset.
When authorized resources (views, datasets, and routines) are
deleted, it takes up to 24 hours for the authorization to delete. So, if
you restore a dataset with an authorized resource less than 24 hours after
deletion, it's possible that reauthorization isn't necessary. As a best
practice, always verify authorization after restoring resources.
Before you begin
Ensure that you have the necessary Identity and Access Management (IAM) permissions to
restore a deleted dataset.
Required roles
To get the permissions that
you need to restore a deleted dataset,
ask your administrator to grant you the
BigQuery User (roles/bigquery.user)
IAM role on the project.
For more information about granting roles, see Manage access to projects, folders, and organizations.
This predefined role contains
the permissions required to restore a deleted dataset. To see the exact permissions that are
required, expand the Required permissions section:
Required permissions
The following permissions are required to restore a deleted dataset:
When you restore a dataset, the following errors might occur:
ALREADY_EXISTS: a dataset with the same name already exists in the
region in which you tried to restore. You can't use undelete to overwrite or
merge datasets.
NOT_FOUND: the dataset you're trying to recover is past its time
travel window, it never existed, or you didn't
specify the correct location
of the dataset.
ACCESS_DENIED: you don't have the required
permissions
to undelete this dataset.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-25 UTC."],[],[],null,["# Restore deleted datasets\n========================\n\n|\n| **Preview**\n|\n|\n| This feature is subject to the \"Pre-GA Offerings Terms\" in the General Service Terms section\n| of the [Service Specific Terms](/terms/service-terms#1).\n|\n| Pre-GA features are available \"as is\" and might have limited support.\n|\n| For more information, see the\n| [launch stage descriptions](/products#product-launch-stages).\n| **Note:** To provide feedback or ask questions related to this preview release, contact [bq-dataset-undelete-feedback@google.com](mailto:bq-dataset-undelete-feedback@google.com).\n\nThis document describes how to restore (or *undelete*) a deleted dataset in\nBigQuery.\n\nYou can restore a dataset to recover it to the state that it was in when it was\ndeleted. You can only restore datasets that are within your\n[time travel window](/bigquery/docs/time-travel#time_travel).\nThis recovery includes all of the objects that were contained in the dataset,\nthe dataset properties, and the security settings. For resources that are not\nrecovered, see\n[Limitations](#limitations).\n| **Caution:** Only the most recent dataset for a given dataset ID can be restored. If you delete a dataset and then create a new dataset with the same ID, you lose the ability to undelete the original dataset. However, you still might be able to [recover specific tables from the deleted dataset](/bigquery/docs/managing-datasets#restore-delete-tables).\n\nFor information about restoring a deleted table or snapshot, see the following\nresources:\n\n- [Restore deleted tables](/bigquery/docs/restore-deleted-tables)\n- [Restore table snapshots](/bigquery/docs/table-snapshots-restore)\n\nLimitations\n-----------\n\nThe following is a list of limitations related to restoring a dataset:\n\n- Restored datasets might reference security principals that no longer exist.\n- References to a deleted dataset in linked datasets aren't restored when you perform this action. Subscribers must subscribe again to manually restore the links.\n- Business tags aren't restored when you perform this action.\n- You must [manually refresh materialized views](/bigquery/docs/materialized-views-manage#manual-refresh) and reauthorize [authorized views](/bigquery/docs/authorized-views#authorize_a_view), [authorized datasets](/bigquery/docs/authorized-datasets#authorize_a_dataset), and [authorized routines](/bigquery/docs/authorized-routines#authorize_routines).\n- You cannot restore a logical view directly. For more information, see [Restore a view](/bigquery/docs/managing-views#restore_a_view).\n- A [BigQuery CDC-enabled table](/bigquery/docs/change-data-capture)\n doesn't resume background apply jobs when restored as part of an\n undeleted dataset.\n\n When authorized resources (views, datasets, and routines) are\n deleted, it takes up to 24 hours for the authorization to delete. So, if\n you restore a dataset with an authorized resource less than 24 hours after\n deletion, it's possible that reauthorization isn't necessary. As a best\n practice, always verify authorization after restoring resources.\n\nBefore you begin\n----------------\n\nEnsure that you have the necessary Identity and Access Management (IAM) permissions to\nrestore a deleted dataset.\n\n### Required roles\n\n\nTo get the permissions that\nyou need to restore a deleted dataset,\n\nask your administrator to grant you the\n\n\n[BigQuery User](/iam/docs/roles-permissions/bigquery#bigquery.user) (`roles/bigquery.user`)\nIAM role on the project.\n\n\nFor more information about granting roles, see [Manage access to projects, folders, and organizations](/iam/docs/granting-changing-revoking-access).\n\n\nThis predefined role contains\n\nthe permissions required to restore a deleted dataset. To see the exact permissions that are\nrequired, expand the **Required permissions** section:\n\n\n#### Required permissions\n\nThe following permissions are required to restore a deleted dataset:\n\n- ` bigquery.datasets.create` on the project\n- `bigquery.datasets.get` on the dataset\n\n\nYou might also be able to get\nthese permissions\nwith [custom roles](/iam/docs/creating-custom-roles) or\nother [predefined roles](/iam/docs/roles-overview#predefined).\n\nRestore a dataset\n-----------------\n\nTo restore a dataset, select one of the following options: \n\n### SQL\n\nUse the\n[`UNDROP SCHEMA` data definition language (DDL) statement](/bigquery/docs/reference/standard-sql/data-definition-language#undrop_schema_statement):\n\n1. In the Google Cloud console, go to the **BigQuery** page.\n\n [Go to BigQuery](https://console.cloud.google.com/bigquery)\n2. In the query editor, enter the following statement:\n\n UNDROP SCHEMA \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-n\"\u003eDATASET_ID\u003c/span\u003e\u003c/var\u003e;\n\n Replace \u003cvar translate=\"no\"\u003eDATASET_ID\u003c/var\u003e with the dataset that you\n want to undelete.\n3. [Specify the location](/bigquery/docs/locations#specify_locations)\n of the dataset that you want to undelete.\n\n4. Click play_circle **Run**.\n\nFor more information about how to run queries, see [Run an interactive query](/bigquery/docs/running-queries#queries).\n\n### API\n\nCall the\n[`datasets.undelete` method](/bigquery/docs/reference/rest/v2/datasets/undelete).\n| **Note:** If you have two deleted datasets in your project with the same name in two different regions, undeleting a dataset with the BigQuery API undeletes only one, selected at random, unless a location is specified.\n\nWhen you restore a dataset, the following errors might occur:\n\n- `ALREADY_EXISTS`: a dataset with the same name already exists in the region in which you tried to restore. You can't use undelete to overwrite or merge datasets.\n- `NOT_FOUND`: the dataset you're trying to recover is past its time travel window, it never existed, or you didn't [specify the correct location](/bigquery/docs/locations#specify_locations) of the dataset.\n- `ACCESS_DENIED`: you don't have the required\n [permissions](#before-you-begin)\n to undelete this dataset.\n\n What's next\n -----------\n\n- For information about querying data at a point in time, see [Access historical data](/bigquery/docs/access-historical-data).\n\n- For information about data retention, see [Data retention with time travel and fail-safe](/bigquery/docs/time-travel).\n\n- For information about how to delete a dataset, see [Manage datasets](/bigquery/docs/managing-datasets)."]]