title: Git push error: "! [rejected] develop -> develop (non-fast-forward)"
body: <p>I have a list of commits (newest first):</p>
  
  <pre><code>abcd4 message
  abcd3 wrong commit message2
  abcd2 wrong commit message1
  abcd1 message
  </code></pre>
  
  <p>I need to change commit messages of <code>abcd2</code> and <code>abcd3</code>.
  I'm doing it the following way:</p>
  
  <pre><code>rebase -i abcd1
  </code></pre>
  
  <p>Then, in interactive mode I replace <code>pick</code> with <code>reword</code>,
  change the necessary commit messages and save the changes. Everything works fine here.</p>
  
  <p>The problem is the following: the branch is fully pushed to Bitbucket so there are wrong commit messages on Bitbucket as well.</p>
  
  <p>I tried to push the changes but got the error:</p>
  
  <pre><code> ! [rejected]        develop -&gt; develop (non-fast-forward)
  error: failed to push some refs to 'https://login@bitbucket.org/user/repository.git'
  hint: Updates were rejected because the tip of your current branch is behind
  hint: its remote counterpart. Integrate the remote changes (e.g.
  hint: 'git pull ...') before pushing again.
  hint: See the 'Note about fast-forwards' in 'git push --help' for details.
  </code></pre>
  
  <p>I tried to pull the changes but got smth. weird after pull was accomplished:</p>
  
  <pre><code>git log --pretty=format:'%h %s' --graph
  *   ccceeefff Merge branch 'develop' of https://bitbucket.org/user/repository into develop
  |\  
  | * abcd3 wrong commit message2
  | * abcd2 wrong commit message1
  * | new_hash_of_abcd3 new commit message2
  * | new_hash_of_abcd2 new commit message1
  |/  
  * abcd1 message
  </code></pre>
  
  <p>So my question is: what is the correct way to change the messages in my case?</p>