6 ms·
There's a few different ways to fix this, but here's what the official docs suggest: https://jj-vcs.github.io/jj/latest/FAQ/#i-accidentally-changed-files-in-the
by abound 1y ago
There's a few different ways to fix this, but here's what the official docs suggest: https://jj-vcs.github.io/jj/latest/FAQ/#i-accidentally-changed-files-in-the-wrong-commit-how-do-i-move-the-recent-changes-into-another-commit https://jj-vcs.github.io/jj/latest/FAQ/#i-accidentally-chang...
TL;DR - `jj evolog` and then restore changes from the relevant secret commit ID
- zamalek 1y agoBut that would undo what I've done, right? I Wang to keep the changes but only diff them against what I've pushed.
- dzaima 1y agoYou can do a `jj new; jj restore --restore-descendants -f commit_id -t @-` with a commit id (not change id!) from the evolog to "inject" a snapshot from the evolog below your current @, leaving the file state at @ (and everywhere else in the log) intact. Or if you have a commit ID (or otherwise revset; so a "main@origin" or whatever would work) of a specific commit that you want already, can use that instead of course too.
- _bent 1y agoi guess you can run `jj duplicate` before?
- sgjennings 1y agoI recently updated that FAQ so it preserves the original commit ID. It’s in the prerelease docs now and will move to “latest” with the release this week: https://jj-vcs.github.io/jj/prerelease/FAQ/#i-accidentally-changed-files-in-the-wrong-commit-how-do-i-move-the-recent-changes-into-another-commit https://jj-vcs.github.io/jj/prerelease/FAQ/#i-accidentally-c...