Revert Commits
You can undo committed changes by reverting one or more commits from your repository's history. Reverting can help you undo commits that perhaps introduced a bug, or back out changes that were accidentally merged to your repository's branch.
When a commit is reverted, the changes from the particular commit are removed from your local workspace, and a new commit is created to reflect your repository as it stands with the removed commits. This way, it's possible to even undo a revert.
Before you revert commits, make sure you commit or stash any pending changes in your workspace if you need them, or reset or rollback changes if you don't need them.
To revert one or more commits: