The undo button works much like the one you're probably used to seeing in MS Word or many other popular applications. It will undo unpublished changes one step at a time.
For example, if you edit a shift's start time, but then change your mind, you can revert the change with the undo button.
Maybe you assigned a shift using drag and drop, but realize you're overstaffed. You can undo that, too.
However, the function is limited to unpublished changes, so it will not unpublish shifts and you will not see it as an option if all your changes are published.