public function undelete( $reason = null, $timestamps = null, $watch = null ) {
		global $pgNotag, $pgTag;
		if( !in_array( 'undelete', $this->wiki->get_userrights() ) ) {
			pecho( "User is not allowed to undelete pages", PECHO_FATAL );
			return false;
		}

		$tokens = $this->wiki->get_tokens();
		if( !$pgNotag ) $reason .= $pgTag;
		$undelArray = array(
			'action' => 'undelete',
			'title'  => $this->title,
			'token'  => $tokens['delete'],
			//Using the delete token, it's the exact same, and we don't have to do another API call
			'reason' => $reason
		);

		if( !is_null( $timestamps ) ) {
			$undelArray['timestamps'] = $timestamps;
			if( is_array( $timestamps ) ) {
				$undelArray['timestamps'] = implode( '|', $timestamps );
			}
		}

		if( !is_null( $watch ) ) {
			if( $watch ) {
				$undelArray['watchlist'] = 'watch';
			} elseif( !$watch ) $undelArray['watchlist'] = 'nochange';
			elseif( in_array(
				$watch, array(
					'watch', 'unwatch', 'preferences', 'nochange'
				)
			) ) {
				$undelArray['watchlist'] = $watch;
			} else pecho( "Watch parameter set incorrectly.  Omitting...\n\n", PECHO_WARN );
		}

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

		Hooks::runHook( 'StartUndelete', array( &$undelArray ) );

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

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