---
title: "Snapshots and forks"
description: "Save an environment before a risky change, put it back, or copy it to try something else."
---

> Documentation Index
> Fetch the complete documentation index at: https://regent.c4n.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Snapshots and forks

A snapshot is a copy of an environment's system and home. Copies are APFS clones: they take
space only as the environment changes. Taking one stops the environment for a few seconds.

```sh
regent snapshot create dev before-upgrade    # named by date if you leave the name out
regent snapshot ls
regent snapshot restore dev before-upgrade   # changes since are lost
regent snapshot rm dev before-upgrade
```

Snapshots outlive the environment: `regent rm` keeps them.

## Fork

`fork` creates a new environment as a copy of another: same profile, agents, sharing and
desktop, with its system and home as they are now or as they were in a snapshot.

```sh
regent fork dev dev2
regent fork dev experiment --from before-upgrade
```

Give two agents a fork each and compare what they did.

Source: https://regent.c4n.dev/docs/guides/snapshots/index.mdx
