Keystoke history

Is it possible to access past commands (history) or step back to a point where a mistake was made and then work forward again?

In the Toolshelf panel there is a History button (shortcut F3)

ctrl+alt+z