[id='rolling-back-server-patches_{context}']
= Rolling back patches

Remove patches from {brandname} Server by rolling them back and restoring the previous {brandname} version.

[IMPORTANT]
====
If a server has multiple patches installed, you can roll back the last installed patch only.

Rolling back patches does not revert configuration changes you make to
{brandname} Server.
Before you roll back patches, you should ensure that your configuration is compatible with the version to which you are rolling back.
====

.Procedure

. Navigate to `{server_home}` for the {brandname} Server installation you want to roll back.
. Stop the server if it is running.
. Start the CLI.
+
[source,options="nowrap",subs=attributes+]
----
bin/cli.sh
----
+
. List the installed patches.
+
[source,options="nowrap",subs=attributes+]
----
patch ls
----
+
[source,options="nowrap",subs=attributes+]
----
{fullbrandname} patch target=$target_version source=$source_version
created=$timestamp installed=$timestamp
----
+
* `$target_version` is the {brandname} server version after the patch was applied.
* `$source_version` is the version for {brandname} server before the patch was applied. Rolling back the patch restores the server to this version.
+
. Roll back the last installed patch.
+
[source,options="nowrap",subs=attributes+]
----
patch rollback
----
+
. Quit the CLI.
+
[source,options="nowrap",subs=attributes+]
----
quit
----
+
. Start the server to verify the patch is rolled back to the previous version.
+
[source,options="nowrap",subs=attributes+]
----
bin/server.sh
----
+
[source,options="nowrap",subs=attributes+]
----
ISPN080001: {brandname} Server $version
----
+
If the patch is rolled back successfully `$version` matches `$source_version`.

[TIP]
====
Use the `--server` option to rollback patches in a different `{server_home}`
directory, for example:

[source,options="nowrap",subs=attributes+]
----
patch rollback --server=path/to/server/home
----
====
