Cover the case when we don't revert changes

Instead of using undefined variable.
Plus, rename the url variable to a more explicit name.
Merge pull request #2087 from winzou/history

Cover the case when we don't revert changes