Category: How do I do X?


This solution is summarized from an archived support forum post. This information may have changed. If you notice an error, please let us know in Discord.

How do I revert to a previous commit of my app?


As a git novice, I need to revert my app to a previous version from 2 commits ago. I am unsure how to do this and also want to know if it is possible to delete the "bad" commits or create a new branch from the "good" commit. I need some guidance to accomplish this.


To revert a Git repository to a previous commit, two options are to use git revert or git reset commands. To begin, open up the terminal, navigate to the directory of the app, and use git log to find the commit hash of the desired "good" commit.

Option 1 is to use git revert with the command git revert to create a new commit that undoes the changes from the "bad" commits. Then push the changes to the remote repository.

Option 2 is to use git reset --hard , which will discard any changes made after the "good" commit. Use git checkout -b to create a new branch with the reset state. Finally, push the new branch to the remote repository.

For an easy GUI way of doing this, you can clone the Appsmith repository into GitHub Desktop and revert the changes as shown.