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.