Builtin Library
README.md
zm.reset
Move the session branch's head — git reset [--soft|--mixed|--hard] <commit>, in one shot (no confirmation step).
target is any revision zm.revParse reads, any commit of the world. { mode = "soft" } keeps the index and the tree (the paths the move changed read as staged); mixed, the default, unstages and keeps the tree; hard unstages and takes the tree to target. zm.reset("HEAD") unstages everything and zm.reset("HEAD", { mode = "hard" }) discards your local changes.
{ stage = name } empties that staging area, any caller's: its staged changes and the outputs (previews) it reserves for them go, the branch head and the tree stay, and emptied says what it held. A target other than HEAD and the soft and hard modes are refused with a stage named.
Reset is non-destructive for history: the commits the head leaves behind become trash entries, and zm.trash("restore", <handle>) re-attaches them in chain order (oldest first).