Sweet. The page has more tips as well like getting partial stuff from your history. I don’t know how much of this will work on OSX but it’s still neat to see.
To activate those two commands, add this to your .bashrc file:
Now you can easily summon any command from the history by typing the command and pressing Up arrow. You might continue pressing Up arrow until you find the command instance you wish to execute again.