Start with a jj repo. Create a workspace, make some commits, then squash them down:
$ jj workspace add --name bar ../bar
$ cd ../bar
$ echo 1 > 1.txt && jj commit -m "bar: 1.txt"
$ echo 2 > 2.txt && jj commit -m "bar: 2.txt"
$ echo 3 > 3.txt && jj commit -m "bar: 3.txt"
$ jj squash -f '@--::@-' -t @--- -m "bar: squashed"
$ cd ../default
$ jj workspace forget bar && rm -rf ../bar
Now the log shows a single clean commit:
$ jj log
@ zlltmlwq [email protected] 2026-02-06 14:44:05 8a1eb736
│ (no description set)
│ ○ ywmkwnlr [email protected] 2026-02-06 11:46:54 ed62a268
├─╯ bar: squashed
○ npxtutrx [email protected] 2026-02-06 11:14:07 5c1486e0
│ initial
◆ zzzzzzzz root() 00000000
Pass the squashed revision to jj-unsquash:
$ jj-unsquash ywmkwnlr
○ otxxpuxp [email protected] 2026-02-06 11:46:54 38184bf6
│ bar: 3.txt
○ vlrtvurz [email protected] 2026-02-06 11:46:54 c95b8e04
│ bar: 2.txt
○ ywmkwnlr [email protected] 2026-02-06 11:46:54 6123fa16
│ bar: 1.txt
~
The three original commits are recovered from the operation log.
Use --diff with a change ID from the output above:
$ jj-unsquash ywmkwnlr --diff vlrtvurz
Added regular file 2.txt:
1: 2
Use --restore to create a browsable workspace with the pre-squash files:
$ jj-unsquash ywmkwnlr --restore
workspace created at ../unsquash-ywmkwnlr
clean up with: jj workspace forget unsquash-ywmkwnlr && rm -rf ../unsquash-ywmkwnlr