git revert commits a reverse change, so from the history point of view you will have two unnecessary commits that cancel each other. The {commit#} in your case should be the ID of the commit that you want to undo (= the last one). This should work as long as there are no other commits on top of it, otherwise you might get conflicts which require more work.
If you don't have any other commits apart from the one you want to undo, there is also a better way - simply move the branch back to point to the last commit you want to keep (= one before last).
Something like this (I assume you are working on master, that you didn't do revert yet and that there are no other people involved):
git checkout -b tmp_branch master~1
git branch -f master tmp_branch
git checkout master
git branch -D tmp_branch
git push -f origin master
And voilà. If your master is protected in GitHub, you will have to unprotect it. You can repeat this to go further back (or just use ~2, ~3 etc.)
revert to previous commit on github?
how to go back to a state at a commit?
Made an error in reverting my git commit
git - Can I revert commits directly on GitHub? - Stack Overflow
Can I revert multiple commits in GitHub?
How do I revert a commit directly on GitHub?
Why is the GitHub Revert button missing?
Videos
Hi, I would like to revert to a previous commit. I believe I did this correctly on my local repository using git reset --hard commit-hash. I would like to push this to github but of this results in
error: failed to push some refs to 'https://github.com/shmish/smartmark.git' hint: Updates were rejected because the tip of your current branch is behind
I am the only working on this repository, so I am not worried about conflicts, I am trying to move back one commit.
I have GitHub Desktop and I have been making regular commits. Now a bug was introduced and I want to go back and get the whole project as it was in time at a previous commit.
How to do that is not entirely intuitive. How do you go back to a previous state of the entire project at the point of a single commit?
There are no local changes according to Github Desktop....
no changesThe commit that I want to go back to is the 3rd commit down on the left. I figure that (according to their instructions) I would revert the two latest commits and I'd be back where I want to be.
a simple plan
But Github protets and claims there are changes.....
only there aren't any changes
But, there aren't any changes.
WTF Github?
I'm not worried about the code......
I'm just irritated that a versioning system so widely used would be so poorly designed.
No, that feature isn't directly available on the GitHub web interface (as opposed to the "Revert" button recently added for GitHub for Mac/Windows)
Actually, it is for pull requests only, since June 24th, 2014:
Introducing the Revert Button
you can easily revert a pull request on GitHub by clicking Revert:

You'll be prompted to create a new pull request with the reverted changes:

git revert is a bit more complex to manage through the web as it can accept a range of commits.
It shouldn't be an issue in terms of collaboration though: a revert adds a new commit, it doesn't change the history of existing commits.
If you want to use just GitHub web, (and you don't mind removing the commit from history instead of leaving a revert commit), there is a tedious way.
Step 1. Goto commit history, find the commit hash which you want to rewind to; and click "Browse repo at this point in history"
Step 2. Create a new branch from this commit hash (say "temp")
Step 3. Delete the branch which had the problem (say "main")
Step 4. Goto "temp" branch and create "main" branch from it. And you're done.
Of course, this is not a good way and it might only work for recently created commits.