import Global from '../../_global.mdx';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# spe container recyclebinitem restore

Restores a deleted container

## Usage

```sh
m365 spe container recyclebinitem restore [options]
```

## Options

```md definition-list
`--id [id]`
: The container id. Specify either `id` or `name` but not both.

`--name [name]`
: The display name of the Container. Specify either `id` or `name` but not both.

`--containerTypeId [containerTypeId]`
: The container type ID of the container instance. Use either `containerTypeId` or `containerTypeName` but not both.

`--containerTypeName [containerTypeName]`
: The container type name of the container instance. Use either `containerTypeId` or `containerTypeName` but not both.
```

<Global />

## Remarks

:::warning

The command is based on an API that is currently in preview and is subject to change once the API reached general availability.

:::

## Permissions

<Tabs>
  <TabItem value="Delegated">

  | Resource        | Permissions                                                        |
  |-----------------|--------------------------------------------------------------------|
  | Microsoft Graph | FileStorageContainer.Selected, FileStorageContainerType.Manage.All |

  </TabItem>
  <TabItem value="Application">

  This command only supports application permissions when using the `containerTypeId` option.

  | Resource        | Permissions                   |
  |-----------------|-------------------------------|
  | Microsoft Graph | FileStorageContainer.Selected |

  </TabItem>
</Tabs>

## Examples

Restore a deleted container by ID.

```sh
m365 spe container recyclebinitem restore --id "b!ISJs1WRro0y0EWgkUYcktDa0mE8zSlFEqFzqRn70Zwp1CEtDEBZgQICPkRbil_5Z"
```

Restore a deleted container by using its name and container type ID.

```sh
m365 spe container recyclebinitem restore --containerTypeId "91710488-5756-407f-9046-fbe5f0b4de73" --name "Invoices"
```

Restore a deleted container by using its name and container type name.

```sh
m365 spe container recyclebinitem restore --containerTypeName "My container type name" --name "Invoices"
```

## Response

The command won't return a response on success.
