1. Revert Commits Individually

The git revert command is used to create a new commit that undoes the changes made by previous commits. This method preserves the commit history.

Step 1 : Identify the range of commits you want to revert using git log.

Revert each commit individually:

git revert <commit-hash1> <commit-hash2> ... <commit-hashN>

Step 2 : Push the new commits to the remote repository:

git push origin <branch-name>

This method is useful for maintaining a clear history of changes while reversing specific commits.