Skip to main content
fjall undo restores the most recent backup of an application’s infrastructure.ts. Each fjall add, fjall remove, and fjall modify writes a sibling .bak file before changing the source. undo rolls the file back to that backup in one step.
  • An application with an infrastructure.ts file (created with fjall create app).
  • A prior codemod (fjall add, fjall remove, or fjall modify) on that application. The .bak file is written by the most recent codemod, so there must be one to restore.

Restore the last change

fjall undo --app <name>
Undo the last change to the api application:
fjall undo --app api
Skip the confirmation prompt (useful in scripts):
fjall undo --app web --yes

What Happens

undo reads the .bak sidecar next to the application’s infrastructure.ts and writes its contents back over the source file.
StepAction
1Resolve the application’s infrastructure.ts path from --app.
2Read the sibling infrastructure.ts.bak backup.
3Restore the backup over infrastructure.ts.
4Print the path it restored from.
The .bak file holds a single prior version. undo reverts the most recent codemod only. To step back through older states, use the timestamped snapshots in the application’s .fjall/history directory. If no .bak file exists, undo exits with an error and leaves infrastructure.ts untouched. Agent mode. Pass --agent to emit a structured result for AI-agent and scripted callers. The output reports the restored path and a follow-up suggestion instead of human-readable text.

Options

OptionDescriptionDefault
-a, --app <name>Application whose infrastructure to undo. Required.None
-y, --yesSkip confirmation prompts.false
-v, --verboseEnable verbose logging.false
--non-interactiveForce plain CLI output (no interactive UI).false

Agent flags

These flags shape output for AI-agent and scripted callers.
FlagDescription
--agentEnable agent output mode.
--budget <level>Output budget: minimal, compact, or a token count.
--fields <fields>Request additional fields in output.
--fullDisable content truncation.

Next Steps

fjall add

Add a resource to an application’s infrastructure.

fjall list

List the resources defined in an application’s infrastructure.

fjall deploy

Deploy infrastructure changes to AWS.

Add resources

Walk through adding and changing resources end to end.