Remote branch ahead of local branch; can't push

I’m trying to push to heroku, but I recently dropped back a few commits as the production and local code were both flawed. Now I’m getting the error:

Updates were rejected because the tip of your current branch is behind its remote counterpart. Merge the remote changes (e.g. ‘git pull’) before pushing again.

  • How to clean a remote GIT repository?
  • does team services provide private repositories?
  • git-upload-pack: command not found
  • Can't push a git repo on a local server
  • heroku fork + heroku git:clone = New app works but empty repository
  • How can I retrieve the remote git address of a repo?
  • I don’t want to pull from the remote, but rather push the code I have locally.

    How can I do that?

  • How do I pull a git submodule from separate project?
  • Git Submodule Files showing red in XCode when moving to different Mac
  • Git shows two branches in remote
  • Git apply vs am
  • How does npm version work?
  • I removed my email and nick from gitconfig, but it's still able to commit
  • One Solution collect form web for “Remote branch ahead of local branch; can't push”

    I’m an idiot. I went back and read the next line.

    If it helps anyone in the future, the answer is to use –force:

    git push heroku master -f
    Git Baby is a git and github fan, let's start git clone.