Skip to main content


previous | prev

check out an ancestor commit

Update to an ancestor commit of the current commit. When working with a stack of commits, you can use sl previous to move down your stack with ease.

  • Use the --newest flag to always pick the newest of multiple parents commits. You can set amend.alwaysnewest to true in your global Sapling config file to make this the default.

  • Use the --merge flag to bring along uncommitted changes to the destination commit.

  • Use the --bookmark flag to move to the first ancestor commit with a bookmark.


  • Move 1 level down the stack:
sl prev
  • Move 2 levels down the stack:
sl prev 2
  • Move to the bottom of the stack:
sl prev --bottom


--newestfalsealways pick the newest parent when a commit has multiple parents
--bottomfalseupdate to the lowest non-public ancestor of the current commit
--bookmarkfalseupdate to the first ancestor with a bookmark
--no-activate-bookmarkfalsedo not activate the bookmark on the destination commit
-C--cleanfalsediscard uncommitted changes (no backup)
-B--move-bookmarkfalsemove active bookmark
-m--mergefalsemerge uncommitted changes
-c--checkfalserequire clean working directory