protected static void revertFile(OutlinerDocument document) {
		// get the document info and file protocol
		DocumentInfo docInfo = document.getDocumentInfo();
		FileProtocol protocol = Outliner.fileProtocolManager.getProtocol(PropertyContainerUtil.getPropertyAsString(docInfo, DocumentInfo.KEY_PROTOCOL_NAME));
		
		// set mode based on whether we were OPENed or IMPORTed
		int mode = PropertyContainerUtil.getPropertyAsBoolean(docInfo, DocumentInfo.KEY_IMPORTED) ? MODE_IMPORT:MODE_OPEN;
		
		// try to open the file and pour its data into that tree
		JoeTree tree = Outliner.newTree(null);
		int openOrImportResult = openOrImportFileAndGetTree(tree, docInfo, protocol, mode);
		if ((openOrImportResult != SUCCESS) && (openOrImportResult != SUCCESS_MODIFIED)) {
			return;
		} else {
			document.setTree(tree);
		}
		
		document.undoQueue.clear();
		document.hoistStack.clear();
		
		// Reset the document attributes
		Outliner.documentAttributes.configure(tree);
		
		// Reset the document preferences
		document.getSettings().setUseDocumentSettings(true);
		syncDocumentToDocInfo(document, MODE_REVERT);
		((DocumentSettingsView) GUITreeLoader.reg.get(GUITreeComponentRegistry.JDIALOG_DOCUMENT_SETTINGS_VIEW)).configure(document.getSettings());
		
		setupAndDraw(docInfo, document, openOrImportResult);
	}