Accidental upvotes used to be a problem, but that's been fixed for a while now. You should see the word "unvote" appear https://i.imgur.com/jaNanv9.png
Downvoting is enabled when your karma reaches a threshold (500?). You can undo votes in either direction via the “unvote” or “undown” links that appear after voting. I think this is only possible for a short period of time after your original vote.
Regarding anything else about how Hacker News works, I found this quite useful:
https://github.com/minimaxir/hacker-news-undocumented/blob/m...