Q:

Roll back my github fork to an earlier commit

I have forked a repo on github and I now want to roll my fork back to a known commit.  I can get the right files locally using
git reset --hard HEAD~1
but then what?
How can I then commit that version back?  Do I add all the current files to the staging area and then commit and push?
EDIT:
Or is what I really need a branch?  Basically, the HEAD of the repo I originally forked uses some new dependencies that I can't rely on, so I want to take the code from that repo and shift it all back X days in the commit history.  I want the newly rolled-back code to be available on github so I can include it as a Gem in my Rails 3 app.
Is that better and can somebody show me how to do that?

A:

You will have to force a push after the reset:
git push origin +master

However, it is not a good idea to force push to a previous commit if the repository is public.
If you do not want to reset the local repository, but want the public one to go back a commit, use a refspec like master~1:master:
git push origin +master~1:master

A branch with commits that do not contain the dependencies can be used in your scenario. For example consider the branch's name to be without_dependencies:
git branch without_dependencies master~1
git push origin without_dependencies

Everyone will be able to see this new branch and work on it.

