ideas: add history repair tool

This is an idea @mhagger and I have been discussing
off-list.