Record your work

glaurung undo

Inspect or revert changes recorded in a project's undo log.

writes files or project state 2 worked examples

use it for

List the log before reverting more than one change. Supply --binary when the project contains more than one binary.

Run glaurung undo --help on your installed version before putting the command in a script. Glaurung is still pre-1.0.

input
A project whose analyst writes entered the undo log.
output
A list of reversible writes or a reverted project state that redo can restore.
mode
writes state. Reverts project writes and makes them available to redo.

command shape

syntax

short form
$ glaurung undo PROJECT [--list] [-n N]

The installed parser is authoritative: glaurung undo --help

before the examples

project setup

The examples use the checked-in hello-c-clang-debug fixture and a project named hello.glaurung.

$ glaurung kickoff samples/binaries/platforms/linux/amd64/export/native/clang/debug/hello-c-clang-debug --db hello.glaurung
$ glaurung comment hello.glaurung 0x1150 checked

run it

examples

Inspect before reverting

The list names the table, record, and field-level change when one exists.

run

from the engine checkout
$ glaurung undo hello.glaurung --list

output

captured result captured 2026-08-31
#4 function_prototypes function_name=print_sum  (no field-level diff)
#3 data_labels va=0x2004  name: '<none>' → 'greeting_format'
#2 comments va=0x1150  body: '<none>' → 'reviews argv and prints a total'
#1 function_names entry_va=0x1150  canonical: 'main' → 'program_main'

captured 2026-08-31.

Read the result: List first when more than one operation may be reverted. Undo order is newest first.

Revert one write

The reverted operation remains available to redo until a new write changes the history.

run

from the engine checkout
$ glaurung undo hello.glaurung -n 1

output

captured result captured 2026-08-31
undo [undone] #4 function_prototypes function_name=print_sum

captured 2026-08-31.

Read the result: The project no longer applies that prototype, but redo can restore it. Inspect the redo stack before making another write.

used above

important options

--list
Inspect the log without changing state.
-n N
Revert N writes; the default is one.
--binary PATH
Select the binary in a multi-binary project.
--json
Return log or operation details as JSON.

These are the flags used by the examples. Run glaurung undo --help for the complete parser help.

before you rely on it

checks

keep working

related commands

← all 40 commands