0

Ok, I followed this advice: git reset --hard <tag/branch/commit id> from this question

And I got this message: HEAD is now at ######## specific update.

The issue is that this is at main branch? I was trying to do this to gh-pages.

How do I roll back to that specific commit in gh-pages?

Thanks

EDIT

Really puzzled by this, but just ran git log right now, and it's at where I chose to roll it back in gh-pages, but if I look at the output of the gh-pages, it's still the same, ie, not to the rollback version, if that makes any sense.

Super puzzled by this!

Community
  • 1
  • 1
user273072545345
  • 1,536
  • 2
  • 27
  • 57

1 Answers1

1

If you really want to do this (you should not mess with the history as soon as other people are involved to the project) you follow this flow:

  • git checkout gh-pages
  • git reset --hard <commit hash>
  • git push -f origin gh-pages

The last one will force push your change to the Github remote and so it will be at your commit hash.

Knut
  • 1,792
  • 13
  • 9
  • thank you! The last line helped to update the changes in gh-pages. No worries on messing the history of this project, as I'm the only person doing the commits. Thanks again! – user273072545345 Jul 16 '14 at 21:38
  • Would I permanently loose my newer commits, after the hard reset? – Qasim Dec 22 '19 at 02:32