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-chang...
TL;DR - `jj evolog` and then restore changes from the relevant secret commit ID
TL;DR - `jj evolog` and then restore changes from the relevant secret commit ID
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.