> For the complete documentation index, see [llms.txt](https://docs.connect.jfrog.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.connect.jfrog.io/features-new-ui/deployments/update-flow/on-failure-and-rollback/rollback-on-failure.md).

# Rollback on Failure

The purpose of a rollback is to ensure that your software will always be able to return to a stable and running state. Rollback on Failure is a rollback of all the steps that have been wholly or partially completed, i.e., a general rollback of the flow. This includes deleting any files that have been delivered, returning the directory structure to its previous state, and undoing any commands and scripts that have run so far. After Rollback on Failure, your previously running versions will be running again.&#x20;

If you choose Run Rollback in any of your steps, you need to enable and configure the Rollback on Failure action. This includes entering the command or script that will perform the rollback.

When you turn on Rollback on Failure here, Run Rollback in each step will be turned on.

To enable Rollback on Failure, do the following:

1. In the Create New Flow page, mark **Rollback on Failure**.&#x20;

<div align="left"><figure><img src="/files/CEmEuspDFFfEovG1YgCT" alt="" width="375"><figcaption></figcaption></figure></div>

2. Choose to run either a command or a script that will perform the rollback.&#x20;
   * **Command**: Include the command and the values for all required parameters.&#x20;
   * **Script**: Prepare the script in advance and upload the file here.

## What's Next?

Learn more about on failure and rollback configurations in [On Failure Policy for Step](/features-new-ui/deployments/update-flow/on-failure-and-rollback/on-failure-policy-for-step.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.connect.jfrog.io/features-new-ui/deployments/update-flow/on-failure-and-rollback/rollback-on-failure.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
