You can try loosening up all the spokes and bending the rim back so it's fairly straight. Then tighten up the spokes evenly and fine-tune.
Even better is to unlace the rim and use a glass coffee table as test for flatness. Bend back the rim against a door-frame until it's flat, then re-lace into wheel.
But yeah, least amount of effort is to replace the rim. Simple to just tape it up next to the original one and transfer the spokes over. Save you having to lace them. Make sure the left-right hole orientation is the same on the new rim when you tape it against the old one.