7
2
In Bash, you can press the up (and down) arrow to traverse through history. You can then modify the command before executing it. Sometimes I've incorrectly modified the command, and wish to reset it to what was in history originally. Is there a way to do this?
I've tried executing a blank line, and then traversing through history again, but the pertinent line remains edited.
I'm always forgetting this one... damn those two-stroke emacs keyboard mappings. – Lambart – 2014-10-21T00:05:16.733
@Lambart I agree. I feel that this is a very useful command for me… but I've never succeeded in memorising it! – Sparhawk – 2014-10-21T00:08:30.850
Almost a duplicate of http://superuser.com/questions/302230/how-to-prevent-bash-from-altering-history , but I'm interested in reverting commands at will, rather than never saving them at all.
– Sparhawk – 2013-05-10T04:24:51.693