Qu

restore_version

Builtin index · File I/O

restore_version(path, version)

Input: path, version · Output: no output

What it is

Writes that version back to path, first keeping the current content as a new version, so a restore can itself be undone. Refused under --sandbox.

Overloads

One call shape — this function is not overloaded.

CodeInputOutputDescription
restore_version(path, version)
path —not documented yet
version —not documented yet
no outputRefused under --sandbox.

Examples

From the documentation, and run by the build -- the output and the figure below are what the engine actually produced. Simplest first.

file_versioning(true)
write_text("notes.txt", "first draft")
write_text("notes.txt", "second draft")    # "first draft" is kept

print(file_history("notes.txt"))
print(read_version("notes.txt", 1))        # first draft

restore_version("notes.txt", 1)            # back to the first draft

not run by the build — this one needs something the repository cannot supply · from file-io