Fix revert for pages in directories

If you try to revert a commit for a page contained in a directory, it does not work (@page is nil).
This is mentioned in issue #736 – I have implemented solution (1) mentioned in the issue, since single SHA revert URLs do not seem to be used.