Introduction
Sometimes you want to undo changes in your project. Git reset helps you move back to an earlier state. It has three ways to do this: soft, mixed, and hard. Each one changes your files and history differently.
When you want to undo a commit but keep your changes to fix or edit them before committing again.
When you want to undo a commit and unstage the changes but keep them in your files to work on.
When you want to completely undo a commit and remove all changes from your files and staging area.
When you accidentally committed too early and want to adjust your last commit without losing work.
When you want to discard all recent changes and return your project to a clean state.