Every time you do something in insert mode then leave back to command mode, vim counts that as one change. There are a few notable exceptions that we'll cover later, but for now, we'll keep it simple. So let's go into insert mode and type one sentence.
Here's my document:
And here's a visualization of vim's undo tree:
-- Hello World!
My first change has an index of 1, great! We can confirm this by running the following command:
:echo changenr() to see a result of 1.
Now let's insert a few more changes, exiting insert mode after each line as you might in the real world while writing code.
Here's my new document:
Happy Howchooing! Dear reader, I hope this guide is helpful. It is my goal in life to help you learn more and become more productive. Enjoy!
-- Happy Howchooing! -- Dear reader... -- It is my goal... -- Enjoy! 
And our current change number is 4.
Let's say we weren't happy with the last couple of changes so we're going to undo them. Pressing
u to undo twice, we end up with the following:
Happy Howchooing! Dear reader, I hope this guide is helpful.
-- Happy Howchooing! -- Dear reader... -- It is my goal... -- Enjoy!  ^ |
Notice that our tree isn't gone, we're just pointing to a lower change number now. The reason our change number isn't 4 or 6 is because pressing
u undo or
ctrl-r redo navigates through the change history effectively moving us up and down the tree. Running
:echo changenr() will reveal that we are indeed at change number 2.
Now we realize we wanted to keep that great line about my goal so let's redo with
ctrl-r. You can guess how that affects our status.
Hello World! Dear reader, I hope this guide is helpful. It is my goal in life to help you learn more and become more productive.
-- Hello World -- Dear reader... -- It is my goal... -- Enjoy!  ^ |
Since all we did was navigate through history, only our change number changes. Everything else remains the same.
Here's the fun part. Now we're going to continue making some changes for a while. Let's say we add 3 new lines.
Happy Howchooing! Dear reader, I hope this guide is helpful. It is my goal in life to help you learn more and become more productive. If it doesn't help you, I have failed I hope you will let me know how I can improve Have a good day!
-- If it doesn't...  -- I hope you...  -- Have a good...  / -- Happy... -- Dear... -- It is... \ -- Enjoy! 
Let's talk about what happened. We continued editing from change number 3. Vim saw that we had changes with a number higher than 3 so vim branched off of the node with index 3. Everything that happened after 3 now lives in one of two branches.
At this point,
u undo and
ctrl-r redo will take us up and down our current branch, never navigating the old branch with the "Enjoy" text. In order to access that, we'll have to use some new commands.
Vim's undo branches are one of those features that you really have to understand what's going on behind the scenes before you can take advantage of it. That said, it really is an underrated feature that is worth taking the time to learn.