Recently, one of the contributors to our project made a commit which broke our system. I am trying to revert back to the latest working release:
I use git log to find the commit:
commit 45359d69e7983946b233d9010f205be19ce8ebfe
Author:Tom
Date: Mon Apr 14 14:59:50 2014 +0100
Tweaks the interface to make it more clean
I then do:
git checkout 45359d69e7983946b233d9010f205be19ce8ebfe
Followed by:
git add -A && git commit -am "revert"
And I finally try:
git push
Which returns:
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'path'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes (e.g. 'git pull') before pushing again. See the
'Note about fast-forwards' section of 'git push --help' for details.
(Where it says path I just removed the url of the server)
Any thoughts?
To revert a commit with git, use git revert $commit
. It will create new commit with the reverse changes (so you will be back at the original version without the changes).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With