zm.toolbox
This package holds more than this page lists. See all of its files in its world.
README.md
zm.restore
git restore.
zm.restore(path)takes the working edits on a path back to what it was staged or committed as: the stage where the path is staged, the last commit where it is not, and absence where it is neither. A folder takes every file beneath it back with it, and a deleted path comes back as its committed version. Edited bytes going back to a committed version are snapshotted to trash first (zm.trashlists them)..restores every path.- A scene's autosave overlay (
<scene>/scene_dirty/..., the live edits no save has written into the scene) goes back with any path that covers it: the scene, a folder above it, itsscene_dirtyfolder or one of its files, and.. - A scene's
scene.jsonand its authored state (itsauthoringfolder, files no commit holds included, and the pending operations recorded against it underscene_dirty/operations) go back as one with any path that covers the scene, names itsscene.jsonor lies in itsauthoringfolder, so the scene loads at the restored state in every client. zm.restore(path, { source = "HEAD~1" })takes the working content to that revision's version instead.zm.restore(path, { staged = true })unstages the path and leaves the working tree as it is;{ staged = true, worktree = true }does both.
Returns { restored, skipped, unstaged }; a path with nothing to restore is listed under skipped.