public function rollback()
	{
		$this->log('rollback', LOG_DEBUG);

		if (!$this->previous_remote_target_dir)
		{
			$this->log('Rollback impossible, no previous deployment found !');
			return;
		}

		if (!$this->check('rollback'))
			return;

		if (is_array($this->remote_host))
		{
			// eerst op alle hosts de symlink terugdraaien
			foreach ($this->remote_host as $remote_host)
			{
				$this->preRollback($remote_host, $this->remote_dir, $this->previous_remote_target_dir);
				$this->changeSymlink($remote_host, $this->remote_dir, $this->previous_remote_target_dir);
			}

            $this->postDeactivation($this->remote_host[0], $this->remote_dir, $this->previous_remote_target_dir);

			// de caches resetten
			foreach ($this->remote_host as $remote_host)
			{
				$this->clearRemoteCaches($remote_host, $this->remote_dir, $this->previous_remote_target_dir);
				$this->postRollback($remote_host, $this->remote_dir, $this->previous_remote_target_dir);
			}

			// als laatste de nieuwe directory terugdraaien
			foreach ($this->remote_host as $remote_host)
			{
				$this->rollbackFiles($remote_host, $this->remote_dir, $this->last_remote_target_dir);
			}
		}
		else
		{
			$this->preRollback($this->remote_host, $this->remote_dir, $this->previous_remote_target_dir);
			$this->changeSymlink($this->remote_host, $this->remote_dir, $this->previous_remote_target_dir);

            $this->postDeactivation($this->remote_host, $this->remote_dir, $this->previous_remote_target_dir);

			$this->clearRemoteCaches($this->remote_host, $this->remote_dir, $this->previous_remote_target_dir);
			$this->postRollback($this->remote_host, $this->remote_dir, $this->previous_remote_target_dir);
			$this->rollbackFiles($this->remote_host, $this->remote_dir, $this->last_remote_target_dir);
		}
	}