I followed a link to the stackoverflow moderator election. I have not voted in these before and I am unfamiliar with the page layout and process. I accidentally hit the mouse while over a "2nd choice" button on one of the candidates. I had no intention to vote, but I don't see a way to undo it. My first instinct was clicking on the button again, but that didn't work.
You can only apply one of your votes at a time to any singular one individual. If, for whatever reason, you want to cancel your secondary or tertiary votes (rather than move them to someone else), vote for one of the candidates you do want to vote for as that slot, then reassert the correct slot.
For example, if you voted A as 1, and B as 2, to simply cancel 2, vote A as 2 then as 1. This will remove your 2nd vote until you return to cast it anew.