I've had this exact thing happen, but with the LLM deciding to screw up code it previously wrote. I really love how Jujutsu commits every time I run a "jj status" (or even automatically, when anything changes), it makes it really easy to roll back to any point.