Fix revert for pages in directories, as seen in issue #736
Merge pull request #758 from samer/master

Fix revert for pages in directories