public function revert( $comment = '', $revertto = null ) {
		global $pgNotag, $pgTag;
		$tokens = $this->wiki->get_tokens();

		if( !$pgNotag ) $comment .= $pgTag;
		$apiArray = array(
			'action'   => 'filerevert',
			'token'    => $tokens['edit'],
			'comment'  => $comment,
			'filename' => $this->rawtitle
		);

		if( !is_null( $revertto ) ) {
			$apiArray['archivename'] = $revertto;
			pecho( "Reverting to $revertto" . "...\n\n", PECHO_NOTICE );
		} else {
			$ii = $this->imageinfo( 2, -1, -1, null, null, array( 'archivename' ) );
			if( is_array( $ii ) ) $apiArray['archivename'] = $ii[1]['archivename'];
			pecho( "Reverting to prior upload...\n\n", PECHO_NOTICE );
		}

		try{
			$this->preEditChecks( "Revert" );
		} catch( EditError $e ){
			pecho( "Error: $e\n\n", PECHO_FATAL );
			return false;
		}

		$result = $this->wiki->apiQuery( $apiArray, true );

		if( isset( $result['filerevert'] ) ) {
			if( isset( $result['filerevert']['result'] ) && $result['filerevert']['result'] == "Success" ) {
				$this->__construct( $this->wiki, $this->title );
				return true;
			} else {
				pecho( "Revert error...\n\n" . print_r( $result['filerevert'], true ) . "\n\n", PECHO_FATAL );
				return false;
			}
		} else {
			pecho( "Revert error...\n\n" . print_r( $result, true ), PECHO_FATAL );
			return false;
		}
	}