I am currently using Git for deploying app to DigitalOcean VPS server. If something wrong with the deployment or the app broken due to bugs in the new source code. how can i rollback to the previous git commit?
I have found the following link useful but i am confused which command i should use.
How to revert Git repository to a previous commit?
Things i want to achieve:
- I want to rollback to previous state of the app.
- The rollback command should only change my server(DigitalOcean) codebase not the Github repository
- The command can be automated.
I have read few answers about git checkout
which required a commit hash i.e. 0d1d7fc32
. However, This approach required some extra steps and might not be useful for automated script.
Thanks in Advance.