This command unstages the file, but it preserves the file contents.
git reset [file]
This command undoes all the commits after the specified commit and preserves the changes locally.
git reset [commit]
This command discards all history and goes back to the specified commit.
git reset –hard [commit]