I will be making changes to a production app soon and I would like to know how to rollback all changes to the database and code. I think with pgbackups and if needed heroku db:push and pull that will rollback the database, but what about the code? Is there a way using git that this could be done, or maybe just to copy the whole folder and copy it back in if there are errors and upload everything again?
Thanks.
I will be making changes to a production app soon and I would like
Share
For managing your code, use git tags.
If the code needs to be rolled back, you can target the older tag during your push to heroku.
You can run
git logto see the history of commits. Find the commit made just prior to your last push to production. Find the hash for that commit (on the same line as the git message in the log) and tag itNow tag your
HEADNow push to heroku
If things go bad, rollback to
v.0.1