Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why doesn't git reset --hard change my local files back to their original state? [duplicate]

Tags:

git

revert

I messed up and actually push a git repo to the url of another one of my repos. I am trying to undo this but am having trouble and I haven't used 'git reset' before.

Say the hash of the last good commit was 12345. I tried doing git reset --hard 12345 which seemed to succeed without error but for some reason it did not change my local files. My local working directory still contains all of the files that were accidentally pushed. How do I revert them?

like image 998
PICyourBrain Avatar asked Jul 02 '12 21:07

PICyourBrain


1 Answers

Are these untracked files? You can remove these by doing:

git clean -f -d

like image 121
triad Avatar answered Sep 27 '22 16:09

triad