you could do 2 45 degree elbows.
Opposing 45s is a good idea since you can twist the first one to the side to move it back to the wall and then straighten it out with the second and keep going. You will have moved the pipe line an inch or two over but you will be closer to the wall

There is no way I would leave the valve covered up in the wall. It might start leaking through the stem and you would never know. I would almost have to bet it is not code either.
Turn the gas off and get rid of the valve in my opinion.
branimal: ok...i'm guessing you have no access to anything from below..if that's the case
you could strap the riser fast to the wall...maybe halfway up the rise....can you shut gas down to remove that valve?




Good point... you think the valve is more likely to leak than the fittings?
I agree on the valve. I'd be nervous leaving it like that.
I always thought that it was a no-no to put any gas pipe fittings behind drywall. If they leak they'll create pockets of gas that you may not smell, that won't dissipate, and that can increase the volitility of an explosion.