added revertFile and restore methods