What are the site rules regarding that? This is the question I'm asking about: "Oh, I didn't really care about what I wrote in the question, but about something I didn't ask about."
mhorans's answer is right. We don't address this explicitly in the tour/TOS, etc, but did discuss a bit with regard to saving questions that were off-topic, but at the same time, interesting, and just needed minor edits to be on-topic. We agreed (somewhere. can't find that discussion now) that if there were answers already, the edits should respect the answers and not change the question substantially enough to make the existing answers out of place.
In this specific situation, the OP making the change, I'd react to your flag if OP rolled back after you. As you've experienced, it can be pretty offputting to compose an answer, only to have the question substantially change.