Vim keeps track of an "undo stack", a linear history of all the changes you've made. Adding something in insert mode adds 1 item to the undo stack. Using
ctrl-r traverses up and down the stack until you being inserting something else.
In command mode, press
u to undo the most recent change. Easy!
To redo the most recently undone command, press