After a little while, a comment on the answer showed me that I was wrong to have edited the answer. How do I undo it?
Your only option is to wait for it to get rejected. Hopefully, the reviewers will notice that it is an erroneous edit and will not blindly approve it. If it does get blindly approved, suggest that the author roll it back. Also suggest that the author contribute to voting on the rejection.
As long as you didn't propose a slew of rejected edits very recently, this singular rejection should not have any true negative impact on your account.