0

I have a Heroku app that has not worked for the last 3 or 4 commits. My site ran fine locally, but I had to push changes in order to see if it would run on Heroku - I have yet to be able to get it to work, so I would like to be able to git rid of the last several commits, both locally and on Heroku.

My attempts at doing this from the terminal and Source Tree have caused a pretty big mess. And while I have been able to rollback my local copy, pushing changes after the rollback get me this error:

hint: Updates were rejected because a pushed branch tip is behind its remote
hint: counterpart. Check out this branch and merge the remote changes
hint: (e.g. 'git pull') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

How can I remove these commits in both places?

asked Aug 22, 2013 at 19:54
1
  • Did you revert your changes, or rebase and deleted the commits? Commented Aug 22, 2013 at 20:05

1 Answer 1

2

I assume by "rollback", you mean you used git reset --hard. In that case, use git push -f to confirm that you really do want to delete those commits from the server. (Keep in mind that you're rewriting history, which is why you need the -f option.)

answered Aug 22, 2013 at 20:05
Sign up to request clarification or add additional context in comments.

1 Comment

Worked like a champ. Thanks!

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.