This question already has an answer here:How to revert a Git repository to a previous commit41 answersI 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?
Let me understand, you want to revert a push? Are you in the repository that pushed or the one that you pushed to?
Does git status show some files as being modified?(What makes you think that Git didn't restore the files?)
Only push affects another repo.Is that your problem here, that doing the reset in one repo didn't affect the other?If so, whichever repo you did the reset in, do the same in the other.
no it's all of the files that were pushed to the repo by accident. And none of the files I want are restored.