Skip to main content

mr note-types revisions restore

Restore a revision of a note type. Without --slot the whole revision becomes the note type's current templates; with --slot only that slot is replaced and every other field stays as it is. --slot takes the primary field name, such as CustomHeader, never the ...CSS sibling. The slot's CSS comes along unless you pass --no-css, which requires --slot.

Restoring moves forward: it records a new revision with source restore and never removes later ones, even when the content already matches the current state. A slot the old revision did not have is restored as empty. A revision whose content no longer passes the ordinary save validation is refused with an error naming the field, and nothing is recorded.

Usage​

mr note-types revisions restore <number>

Positional arguments:

  • <number>

Examples​

Restore the whole of revision 1

mr note-types revisions restore 1 --id 3

Restore only the header and keep the current header CSS

mr note-types revisions restore 2 --id 3 --slot CustomHeader --no-css

Flags​

FlagTypeDefaultDescription
--iduint0ID of the note type (required)
--slotstring``Restore only this slot, for example CustomHeader (default: the whole revision)
--no-cssboolfalseWith --slot, leave the slot's CSS as it is now

Inherited global flags​

FlagTypeDefaultDescription
--jsonboolfalseOutput raw JSON
--no-headerboolfalseOmit table headers
--pageint1Page number for list commands (default page size: 50)
--quietboolfalseOnly output IDs
--serverstringhttp://localhost:8181mahresources server URL (env: MAHRESOURCES_URL)

Output​

Summary of the new restore revision with number, source, restoredFrom and changedSlots under --json; confirmation otherwise

Exit Codes​

0 on success; 1 on any error

See Also​