Each edit has a five minute window in which you can make subsequent changes and have them rolled into the same revision, provided no one else made changes in between. What happens in this case is that the original change is reverted by the editor during that grace window, as if no edit was ever performed.
This wasn't recorded for a very long time, but that was changed to avoid potential abuse of the fact that votes are unlocked after editing, and you could make an edit, change your vote, and undo the edit without anyone knowing.
I seem to also recall a case of someone vandalizing a user's answer, allowing it to attract down votes, and then undoing their vandalism within the window, preserving the down votes but effectively erasing the history of their actions.
I wasn't fully sold on the necessity of this safeguard at the time, but you can read more in the implementation discussion.