The following guide shows how to restore an individual file from a snapshot.

Similar to [reverting an instance](https://docs.cloud.google.com/sdk/gcloud/reference/filestore/instances/revert),
using a snapshot to restore a single file is a destructive operation. Use this
feature carefully. For a detailed description of snapshot limitations,
see [Snapshot feature limitations](https://docs.cloud.google.com/filestore/docs/snapshots.md.txt#feature_limitations).

### gcloud CLI

To restore a file to a previous state that's captured in a snapshot, run the
following command from a client VM that has the instance mounted:

```bash
sudo cp -pa MOUNT-POINT-DIRECTORY/.snapshot/SNAPSHOT_ID/FILE MOUNT-POINT-DIRECTORY
```

#### Example

If you want to restore file `mount-point-directory/genomics-file.txt` to the state preserved
in snapshot `snap2`, run:

```bash
sudo cp -pa mount-point-directory/.snapshot/snap2/genomics-file.txt mount-point-directory/
```

## What's next

- [Snapshots overview](https://docs.cloud.google.com/filestore/docs/snapshots.md.txt)
- [Revert an instance to a prior snapshot state](https://docs.cloud.google.com/filestore/docs/revert-snapshot.md.txt)
- [Schedule Filestore enterprise snapshots](https://docs.cloud.google.com/filestore/docs/schedule-filestore-enterprise-snapshots.md.txt)
- [Backups overview](https://docs.cloud.google.com/filestore/docs/backups.md.txt)