First, the practical part:
If you notice that a post that you flagged has been improved, you can retract the flag. Click the "flag" button and choose "Retract Flag" in the flagging dialog.
On to the question:
If the flag is handled before you are able to retract it - well, you could very well get the flag declined. It happens.
When you flag a post, it will be entered into a review queue. Here, other users who have the "review" privilege will see the post as it is when they start the review. So if it was edited before a reviewer sees it... the reviewer will see the edited post. In the example of a formerly unclear question, they will hopefully conclude that the question is now clear.
As user That1Guy points out, a post can also be edited while in the review queue, and this may lead to the post being removed from the review queue. In this case (as Nathan Tuggy points out), this should lead to the flag being "disputed".
All of this may seem a little unfair to flaggers. But there is no point in asking reviewers to review a post as it was before it was edited - the former version of the post is mostly irrelevant to Q&A, so asking people to judge it is a waste of everybody's time and effort. Reviewers judge the post as it is now, because that is the version that is active on the site.
If enough reviewers vote that the post is OK, the flag will be declined.
If there is sufficient disagreement, the flag will be disputed.