I've done different things in different circumstances.
Sometimes I edit my answer to follow the question. This strategy is good if the updated question/answer is a better pair of posts (more likely to be useful to others) than the originals were. For example if the original answer points out an idiosyncratic misunderstanding in the question, I'm usually happy to move the answer. However, if it continues to happen that the question changes substantively I tend to ask the OP to instead post a new question.
On occasion -- especially if the original Q & A were good -- I roll-back and ask the OP to post a new question (or if I have a sense that the OP would respond, I ask the OP to roll-back and post a new question -- it's better not to fiddle with questions if the OP can be induced to do so)
a few times I have simply edited some of the original question back in (to the question or more typically as a quote into my answer) -- this makes sense as long as that part of the answer has some value. I sometimes do the same with comments I respond to.
Sometimes I have done other things.
Where possible, good questions/answers should be retained and questions should correspond to answers. As long as we try to make reasonable choices I'm not sure there's much value in dictating a single policy.