history

...
550 Mon 20 Feb 2017 09:02:51 AM +03 : cd test
551 Mon 20 Feb 2017 09:02:52 AM +03 : ls
552 Mon 20 Feb 2017 09:02:58 AM +03 : source bin/activate
....

Assuming we want to rerun source bin/activate, type:

!552

[Or !552:p to print the command.]

Alternatively you can use:

fc -s 552