Let’s say you have made mulitple commits, but the last few were bad and you want to rollback to a previous commit:
git log // lists the commits made in that repository in reverse chronological order
git reset --hard <commit-sha1> // resets the index and working tree