Proper state change when restoring files from the history sidebar