Introduction
Sometimes you make a change in your project that you want to undo without removing the history. git revert helps you undo a commit by creating a new commit that reverses the changes safely.
When you want to undo a change but keep the project history intact.
When you have already shared your commits with others and cannot rewrite history.
When you want to fix a mistake in a previous commit without deleting it.
When you want to undo a commit on the main branch without causing conflicts.
When you want to keep a clear record of what was undone and why.