When I run git reset --hard HEAD
, it's supposed to reset to a pristine version of what you pulled, as I understand it. Unfortunately, it leaves files lying around, as a git status
shows a big list of untracked files.
How do you tell git "Just bring it back to EXACTLY what was in the last pull, nothing more, nothing less"?
git reset --hard
resets your index and reverts the tracked files back to state as they are in HEAD. It leaves untracked files alone. – Tannen../../file.yaml
. Instead you need to firstcd ../../
then dogit reset --hard
and/orgit clean -fd
to reset everything. When you rungit status
nothing should be any directories above you. An easy way is to just do these commands from the base directory of the repo. – Forecourse