> For the complete documentation index, see [llms.txt](https://help.sleuth.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.sleuth.io/sleuth-dora/modeling-your-deployments/code-deployments/rollbacks.md).

# Rollbacks

Sleuth supports the deployment of a previously deployed code revision, otherwise know as a rollback.

![](https://2832637360-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M1bR_-Od0islbiOl4G0%2Fuploads%2Fgit-blob-8754e0885692cfca74a3f7ab8dad8fdd19e4fc66%2Fsleuth%20-%20Sleuth%20-%20973f846%202021-06-24%2015-03-47.png?alt=media)

It's not too uncommon for a team to deploy a code change and then realize, after some time, that the change isn't behaving how they intended. The most common strategy to deal with this is to roll-forward, making a quick fix for the new error. However, sometimes it's too difficult to make a quick fix and you decide to revert to the last known good code revision.

Sleuth automatically detects rollbacks by checking the SHA of the deploy currently being deployed against the SHAs of all existing deploys in the target environment. If a matching SHA is found on an existing deploy, Sleuth will do the following:

* Register the new deploy as a rollback and tag it with the tag <mark style="color:red;">`rollback`</mark>
* Identify all deploys registered between the rollback deploy and the initial deploy with the same SHA, and mark them as rolled back, changing their health to `Rolled back` and adding the tag <mark style="color:red;">`rolled_back`</mark>

![](https://2832637360-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M1bR_-Od0islbiOl4G0%2Fuploads%2Fgit-blob-a16d8e41b84cfd784a5615adba1c08f9830369b1%2Fsleuth%20-%20Sleuth%20-%20f976d31%202021-06-24%2015-13-10.png?alt=media)

Rollbacks, by default, are counted as a failure when determining your [Change failure rate](/sleuth-dora/accelerate-metrics/change-failure-rate.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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.sleuth.io/sleuth-dora/modeling-your-deployments/code-deployments/rollbacks.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
