I feel like this question has been asked many times, but the solution is typically “I deleted the directory and re-did my work with a fresh checkout.” I did a commit and push but realized that I referred to the wrong ticket number in the commit message. So I looked on SO for a quick solution and ended up typing the following into the terminal:
$ git reset --soft HEAD^
$ git commit -m "... correct message ..."
The only problem is I am getting the following error message:
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes before pushing again. See the 'Note about
fast-forwards' section of 'git push --help' for details.
I am using the git-flow model and am working on the develop branch. How can I merge things back in to make git happy again?
Force
git push: