There is no way to un-flag a post, unfortunately. However, the post you flagged most likely will not accrue any additional spam flags. While the moderator may spend some time trying to figure out why someone marked it as spam, a moderator who looks at your flag will most likely decline the flag and take no actions.
One thing you could do is leave a comment on the post saying that you accidentally flagged the post but didn't mean to. This would help the moderator quickly figure out that no actions are needed. After reviewing the flag, the moderator should delete your comment.
You could also see if a moderator is active in a chat room, in which case you could give that person a link to the post.
Lastly, you should know that the system only takes action on posts when the number of spam flags reaches a certain threshold. One flag shouldn't do any permanent damage. In the future, just be sure you're flagging the right post ;)