Undoing commits
Use the git revert command to undo previous commits. This is the most common method of undoing changes.
The revert command creates a new commit that reverts the changes made by a previous commit. It allows you to undo unwanted changes without removing the commit entirely or modifying the repository's history. It’s a useful tool for managing changes to a Git repository while preserving its history.
While you can delete a prior commit from the history using the commands git reset or git rebase -i, it is generally not recommended because it causes the remote repository to diverge from the local repositories of other members.
