How do you reset your working directory to the last commit in Git?
a)
git reset --hardb)
git revert HEADc)
git checkout --lastd)
git reset HEADAnswer:
a)
git reset --hardExplanation:
The git reset --hard command resets your working directory, index (staging area), and HEAD pointer to the state of the last commit. It discards all changes in the working directory and the staging area, effectively reverting the repository to the last committed state.
This command is useful when you want to discard all uncommitted changes and return to a clean working directory.
Be cautious when using git reset --hard as it permanently deletes uncommitted changes.