In general, when a question is edited such that your answer no longer applies, you have the following options, in decreasing order of preference:
- Edit your answer such that it actually does answer the updated question (recommended)
- Delete your answer (recommended if you don't feel that you can adequately answer the updated question)
- Ask the questioner if they would be willing to revert the edit, and perhaps post the new version of the question as its own post
- Leave your answer in place, but in this case you run the risk of the answer being downvoted because it doesn't address the question in its current form
- Revert the edit yourself (not recommended unless the OP okays it)
In some cases, when a question is edited such that one or more answers no longer apply, if the edit is exceptionally disruptive, it would be appropriate to revert it. What counts as "exceptionally disruptive" is a judgment call made on a case-by-case basis, but in making that decision some of the factors that should be taken into account include:
- how much the edit changed the meaning of the question
- whether the edit reflects a change in what the poster intends the question to mean
- whether the edit was prompted by comments asking for clarifications
- the quality of the original question
- the number of answers that would be invalidated by the edit
- the quality of the answers that would be invalidated by the edit
As a rough guideline, what I would consider "exceptionally disruptive" is something like: the OP has changed their mind about what they want to ask, and the question's meaning is changed significantly, and the original question was good quality, and multiple upvote-worthy answers would be invalidated by the change. I've seen situations like this come up occasionally on the site, and I've reverted edits in those cases, but it's very rare.
tl;dr: in this situation specifically, deleting your answer seems like the most appropriate course of action.