Sometimes, you might need to revert to a previous version of your code if a new update causes problems or bugs. With atomic deployment, this is very easy to do.
All you need to do is run the following command in your local Git repository:
git reset --hard HEAD~1This will undo the last commit, and reset your local code to the previous state. After doing this, you’ll need to push the commit to the main branch of your remote repository:
git push This will overwrite the remote branch with your local code. Since you have set up a webhook with RunCloud, this will trigger an Atomic deployment automatically. RunCloud will create a new release folder with the previous version of your code, install the dependencies, and activate it as the current one.
That’s it! You have successfully reverted to a previous version of your code using Atomic deployment.
Backups and Restoration for Atomic Deployments
While you can create a backup of an atomic deployment just like any other standard application on RunCloud, the restoration process is fundamentally different.
Please be aware that you cannot restore an atomic deployment using the standard RunCloud restore feature.
Because atomic deployments aren’t typical web applications and rely on a unique symlinked folder structure, standard backups don’t capture the application in a format that can be restored using traditional methods. If you download an atomic deployment backup archive, you will find that it contains only your persistent data (config files and storage directories), not your application code.
Because your application is inherently linked to Git, “restoring” your application should be handled through version control.
If you need to roll back your site to a previous state, you can deploy an older Git commit by reverting a commit in your Git repository and pushing the changes to trigger a new deployment as described above.
