History And Restore
Graft uses a Git-like repository model for app data:
worktree -> index -> commitSQLite transactions update the current database state. Graft commits record which database snapshots and file artifacts should be treated as a named app state.
Commit A Version
Section titled “Commit A Version”graft statusgraft add --allgraft commit -m "save checkpoint"Inspect history:
graft loggraft log --jsongraft show HEADgraft show --json HEADBranch And Switch
Section titled “Branch And Switch”Create a branch:
graft branch feature/searchgraft switch feature/searchCreate and switch in one command:
graft switch -c feature/search mainList branches:
graft branchgraft branch -rgraft branch -aSwitching branches materializes the target commit’s tracked SQLite snapshots and file artifacts into the worktree.
Restore One Path
Section titled “Restore One Path”Restore a worktree path from HEAD:
graft restore --source HEAD -- data.sqliteRestore a path from an older revision:
graft restore --source HEAD~1 -- attachments/report.pdfUnstage a staged path:
graft restore --staged -- data.sqliteUnstage every staged path of one kind:
graft restore --staged --all --kind sqlite_databaseCheckout A Revision Or Path
Section titled “Checkout A Revision Or Path”Check out an entire revision:
graft checkout HEAD~1Restore one path from a revision:
graft checkout HEAD~1 data.sqliteUse checkout for revision movement or Git-style path restore. Use restore
for explicit staged/worktree restore operations.
Reset HEAD
Section titled “Reset HEAD”Move the current branch while keeping staged and worktree state:
graft reset --soft HEAD~1Move the branch and reset the index:
graft reset --mixed HEAD~1Move the branch, reset the index, and materialize the target revision:
graft reset --hard HEAD~1--hard discards staged and unstaged worktree changes. Use it only when that is
the intended operation.
Create a lightweight tag:
graft tag v0.1Create an annotated tag:
graft tag -a v0.1 -m "first checkpoint"List or delete tags:
graft taggraft tag -d v0.1