What do we do if disaster strikes and our newly released code breaks our application? Luckily for us, Heroku keeps a copy of every deploy and configuration change to our application. This enables us to roll back to a previous version while we work to correct the errors in our latest release.
Note
Heads up! Rolling back only affects application code and configuration variables. Add-ons and our database will not be affected by a rollback.
In this recipe, we will learn how to manage our releases and roll back code from the CLI.
In this recipe, we'll view and manage our releases from the Heroku CLI, using the releases
command. Let's open up a terminal now and navigate to one of our Heroku projects by performing the following steps:
Heroku tracks every deploy and configuration change as a release. We can view all of our releases from both the CLI and the web dashboard with the
releases
command:$ heroku releases === load-tester-rails Releases v33 ...