# Disable and roll back

> Turn a patch off, switch back to an earlier installed version, and what rollback can't undo.

Source: https://retoque.xyz/docs/rollback
Markdown: https://retoque.xyz/docs/md/rollback

A patch is a separate adapter file, so turning it off is a state change, not a reinstall. The base weights are only ever read. Every switch rewrites one small JSON file, `~/.retoque/state.json`, atomically.

## Disable and enable

> [!fix] **Unclip a patch.** `disable` keeps the files and makes `run` load the pure base model. `enable` turns the same version back on.

```sh
retoque disable <slug>
retoque run --patch <slug> --input task.json   # now runs the pure base model
retoque enable <slug>
```

`run` prints which adapter sha256 was active, or "none, pure base" with the reason. To compare once without changing state, pass `--no-patch` to a single `run`.

## Roll back to an earlier version

> [!fix] **Roll back.** Rollback switches the active version to one that is already installed. It re-verifies that version's signature and every file hash first, then enables it and re-pins `retoque.lock`.

```sh
retoque status                          # installed versions and history
retoque rollback <slug> --to <version>
```

If the target version isn't installed, the command lists what is and changes nothing. Install the older version first with `retoque install <slug>@<version> --model ...`, which also makes it active. Rolling forward again is the same command with the newer version.

`status` shows the switch history as `1.0.0 -> 1.1.0 -> 1.0.0`, so you can see how a project got to its current version.

## In your own Python process

With PEFT, code inside `with model.disable_adapter():` runs on the base model. In the published evaluation, outputs in that block were compared with the base model case by case, and the report records whether they matched exactly. See [Python with PEFT](https://retoque.xyz/docs/python).

## In vLLM

Adapters are fixed when the server starts. Send the base model name in the `model` field to skip the adapter, or restart the server with a different `--lora-modules` path to switch versions. See [Serving with vLLM](https://retoque.xyz/docs/vllm).

## What rollback can't do

- It can't undo a merge. If you ran `merge_and_unload()` and saved the result, that checkpoint has the patch baked in. Keep the original base.
- It doesn't touch other machines. Each install has its own state. Commit `retoque.lock` so others can see which digests you pinned.
- It doesn't recall a version. Withdrawn versions stay on disk wherever they were installed, and nothing deletes them remotely.
- It doesn't uninstall. There is no remove command in 0.1.0. Installed directories stay under `~/.retoque/patches` until you delete them yourself.
