Fix regression where current version of a file could be restored