If it were me, I would cut the pipe just above the u bend in the trap leaving as much pipe as possible coming down from the 90 sticking out of the wall. I would go get a new trap and trap adapter and a 1' piece of PVC (bring the cut out u bend and trap adapter with you). I would also get what's called a "mission coupling". It's a rubber coupling with metal band around it and use that as the coupling between the pipe coming down from the 90 and the u bend. It tightens with 2 hose clamps and will allow you to move the trap left or right without having to worry about being permanent but you'll need to add a piece of pvc to outlet side of the new trap so the coupling has something to grab onto. Before you glue anything together dry fit everything because you may need to trim the pipe coming down from the 90 so the bottom of the trap will fit.