If you realize your mistake immediately you should be able to undo an upvote by clicking upvote a second time (at least it works for me); similarly for a downvote. (Try it on my answer here -- click upvote, say "oops, didn't mean that", then click up a second time and the vote should come back off again. Then click upvote a third time because my answer is just the greatest, we have the best answers, everyone thinks so.)
It may seem a little counterintuitive at first but once you get used to it, it will seem fairly natural.
If you don't realize you want to change your vote fairly quickly (more precisely, within five minutes), you'll be outside the window in which you can change your mind, in which case your vote will not be changeable until the post is edited.