restore
Recover a form YAML from a run artifact's frozen config.yaml snapshot. Every run copies the source YAML into the artifact dir — restore brings it back to the library.
basic usage
bash
gform restore # TTY: pick an artifact
gform restore a3f9c1e2b4d60718
gform rs a3f9c1e2 # prefix match works
gform restore a3f9c1e2/r01 # child run inside a batchWrites to $GFORM_HOME/forms/<name>.yaml using the name: from the snapshot. Refreshes the stamped comment header; keeps the snapshotted options / steps / unique / pools intact (not an init scaffold).
Find ids with gform run list or gform run last. See artifacts.md.
save under a new name
bash
gform restore <id> --save-as <name>
gform restore <id> -a backupRewrites the name: field and uses the new basename. Cannot use reserved names: list, ls, view, v, last.
custom output path
bash
gform restore <id> --out ./recovered.yamlWrites to an explicit path instead of the library.
force overwrite
bash
gform restore <id> --force
gform restore <id> --save-as <name> --forceWithout --force, restore refuses if the destination file already exists.
when to restore
| situation | action |
|---|---|
| accidentally edited/deleted library YAML | restore <id> from last good run |
| compare what actually ran vs current file | restore to --save-as temp name |
| batch child used different pool resolution | restore parent batch id's config |
| artifact predates config snapshots | not restorable — no config.yaml |
Restore prints the artifact id and original sourcePath when available.
gotchas
- Only artifacts with
config.yamlwork — very old runs may lack it. - Restore validates via the same schema as
gform verify. - Restoring does not delete the artifact — it's a copy out.
- Batch parent id restores the batch-level config (the YAML used for the whole batch).
related
- artifacts.md — snapshot layout
- run.md —
run list/run view - verify.md — check restored YAML
- add.md — alternative install path