Once the elastic is secure, you can trim of the excess of each side, switch out to the thread that matches the topstitching you unpicked, and sew back over that part to close the waistband back up. If you look really closely you’ll probably be able to tell that your stitching is a little smaller than the rest of the topstitching, but no one else will every notice.