If you haven’t generated dependencies for other collaborators with your code and you wish to back up several commits, this should work just fine:

$ git reset --hard
HEAD is now at xxxxxxx Description
$ git push -f  Total 0 (delta 0), reused 0 (delta 0)
To https://github.com/username/repository.git
+ 725b5eba...12739094 master -> master (forced update)

Support this site, share this page:Share on twitter

Twitter

Share on reddit

Reddit

Share on linkedin

Linkedin

Share on facebook

Facebook

Share on email

Email