Reset to default
Trending sort is based off of the default sorting method — by highest score — but it boosts votes that have happened recently, helping to surface more up-to-date answers.
It falls back to sorting by highest score if no posts are trending.
This article has an excellent explanation as to how to go about various scenarios (where a commit has been done as well as the push OR just a commit, before the push):
From the article, the easiest command I saw to revert a previous commit by its commit id, was:
git revert dd61ab32
You can do
git push --force but be aware that you are rewriting history and anyone using the repo will have issue with this.
If you want to prevent this problem, don’t use reset, but instead use
Or you can try using git revert http://www.kernel.org/pub/software/scm/git/docs/git-revert.html. I think something like
git revert HEAD~1 -m 1 will revert your last commit (if it’s still the last commit).
Unable to comment on others answers, I’ll provide a bit of extra information.
If you want to
revert the last commit, you can use
git revert head.
head refers to the most recent commit in your branch.
The reason you use
head~1 when using
reset is that you are telling Git to “remove all changes in the commits after” (
reset --hard) “the commit one before head” (
reset is to a commit,
revert is on a commit.
As AmpT pointed out, you can also use the commit SHA to identify it, rather than counting how far away from
head it is. The SHA can be found in the logs (
git log) and a variety of other ways.
You can also always use any other pointers in Git. e.g. a tag or branch. And can also use all of these fun other ways to reference commits https://www.kernel.org/pub/software/scm/git/docs/git-rev-parse.html#_specifying_revisions
I think you need to push a revert commit. So
pull from github again, including the commit you want to revert, then use
git revert and push the result.
If you don’t care about other people’s clones of your github repository being broken, you can also delete and recreate the master branch on github after your
git push origin :master.