0

I had to revert to a previous commit by running:

 git revert <HASH>

So I go push the changes back into my remote repo and it failed with:

 ! [rejected]        ci_172 -> ci_172 (non-fast-forward)
 To prevent you from losing history, non-fast-forward updates were rejected
 Merge the remote changes before pushing again.  
sdot257
  • 10,046
  • 26
  • 88
  • 122

2 Answers2

0

You need made a pull before

git pull origin
git push origin

The pull made a fetch and merge from origin. After this merge you can push your commit

shingara
  • 46,608
  • 11
  • 99
  • 105
0

You are going to need to force the push with git push [remote-path] +[branch]. So, if I was pushing master to origin, that would look like git push origin +master.

You can see more at How can I remove a commit on github?.

Community
  • 1
  • 1
Benjamin Manns
  • 9,028
  • 4
  • 37
  • 48