Resetting
The git reset command is a versatile tool that allows developers to undo changes to a project's commit history by manipulating gits three state management mechanisms: The HEAD, staging index, and working directory. It has three primary options that can be applied when invoked. These are --soft, --mixed, and --hard. These options determine how the projects state is modified.

Checkout vs. Reset

Main Branch
Checkout
Git checkout
Reset
Git Reset Images from Atlassian: Git reset
The Steps of Resetting:
  1. Moves the HEAD: The first thing that reset will do regardless of what additional options are chosen is move where the HEAD points to. When the --soft option is invoked this step is where the process will stop.
  2. Updates the Staging Index: After moving the HEAD the next thing reset will attempt to do is update the staging index by changing it's state back to the specified commit. Any changes that are undone from the staging index are moved back into the working directory. With the --mixed option the reset process will stop here.
  3. Updates the Working Directory: Lastly, reset will make the working directory look like the staging index if the --hard option is invoked. This final step is DANGEROUS. This will undo your git add and git commit commands, and all the work you did in the working directory.
Use Cases:
Examples:
Reset to specific commit and keep changes staged:
git reset --soft [commit-hash]
Reset to specific commit and unstage changes:
git reset [commit-hash]
git reset --mixed [commit-hash]
Reset to specific commit and discard all changes (DANGEROUS):
git reset --hard [commit-hash]
Reset specific file back to the state of a particular commit:
git reset [commit-hash] [file-name]