git reset --hard <old-commit-id>
git push -f <remote-name> <branch-name>
Note: As written in comments below, Using this is dangerous in a collaborative environment: you’re rewriting history
More Related Contents:
- How to determine the URL that a local Git repository was originally cloned from?
- How to remove file from Git history?
- Git Init in home directory – now unable to commit changes
- Does github remember commit IDs?
- Is it possible to include a file in your .gitconfig
- Git – remote: Repository not found
- There is no tracking information for the current branch
- How to disable osxkeychain as credential helper in git config?
- Can deleted .git be restored?
- How can I fetch an unmerged pull request for a branch I don’t own?
- Having Trouble Switching Github accounts on terminal
- How to compare two different commits on the same branch in github?
- How do I avoid the specification of the username and password at every git push?
- Push existing project into Github
- Recursively add the entire folder to a repository
- github: No supported authentication methods available
- Git best practice for config files etc
- Git asks for username every time I push
- How do I add files and folders into GitHub repos?
- With GitHub how do I push all branches when adding an existing repo?
- Git pushing to remote GitHub repository as wrong user
- How to sync with a remote Git repository?
- Git push failed, “Non-fast forward updates were rejected”
- git clone hangs forever on github
- Push and pull my conda environment using git
- Transfer git repositories from GitLab to GitHub – can we, how to and pitfalls (if any)?
- Pushing a large github repo fails with “unable to push to unqualified destination: master”
- Git cannot lock ref ‘HEAD’: unable to resolve reference HEAD
- Git clone repository error: RPC failed; result=56, HTTP code = 200
- npm install package from github repo subfolder