What is the purpose of git reset?

The git reset command is used to move the HEAD pointer and the current branch pointer to a specific commit, with different modes available.

  1. Reset the current branch to the last commit while keeping changed files staged.
  2. reset the git changes and keep the changes in the working directory.
  3. Discard all changes and revert to the last committed state.

In general, the git reset command can be used to undo previous commits and roll back to a specified commit version.

bannerAds