---
title: "ktm tests restore"
description: "Restore a test to a previous version"
sidebarTitle: "restore"
lastUpdated: "2026-09-23"
---

> **For AI agents:** the complete documentation index is at [llms.txt](/llms.txt). Append `.md` to any page URL for its markdown version.

{/* GENERATED FILE: do not edit by hand. Regenerate with: node scripts/generate.mjs */}

Restore a test to a previous version

## Usage

```bash
ktm tests restore <history-id> [flags]
```

## Examples

```bash
# Find history versions
ktm tests history 16480 --date 2026-03-06

# Restore to a specific version
ktm tests restore 42
```

## Arguments

| Argument | Required |
| --- | --- |
| `history-id` | Yes |

## Details

Restore a test to a historical version by its history ID.
Use "tests history &lt;test-id&gt; --date &lt;date&gt;" to find available history IDs.

This is destructive — it overwrites the current test definition.

## Related

- [`ktm tests`](/cli/commands/tests)

<Note>
  Global flags (`--output`, `--debug`, `--host`, …) apply to every command. See the [command reference overview](/cli/commands/overview).
</Note>

## What's next?

<Columns cols={2}>
  <Card title="All commands" icon="terminal" href="/cli/commands/overview">
    Browse the full CLI reference.
  </Card>
  <Card title="Get started" icon="rocket" href="/cli/getting-started">
    Install the CLI and authenticate.
  </Card>
</Columns>
