0

I accidentally pushed something I didn't want to to a repository. I followed the steps here but, although it did revert the code, there's still a log of what happened that I wish to erase: the log

To clarify, I want things to be as though everything after commit 1a869f3c6d simply never happened.

I have full access to the server where this repository is hosted, so I can manually modify some of the configuration files if necessary. And I don't know if this is really relevant, but the git server being used is Go Git Service.

Disclaimer: I understand why I may not want to do this. If you're only going to respond with why it's a bad idea, please don't.

Community
  • 1
  • 1
clb
  • 715
  • 9
  • 23

1 Answers1

1

To back out the latest commit on master, use git reset --hard:

git checkout master
git reset --hard master~1
git push -f

Or if you know the commit you want master to point to:

git reset --hard 1a869f3c6d
Jonathon Reinhart
  • 132,704
  • 33
  • 254
  • 328
  • Thanks, unfortunately this does still leave the traces of the two pushes as shown in the image. The more I think about it, the likelier it seems that I will have to manually modify some of the files on the server... – clb Dec 27 '16 at 02:24