Basically, we undid history. I know this is bad, and I am already committed to avoiding this at all costs in the future, but what is done is done.

Anyway, I issued a git push origin <1_week_old_sha>:master to undo some bad commits. I then deleted a buggered branch called release(which had also received some bad commits) from remote and then branched a new release off master. I pushed this to remote. So basically, remote master & release are clones and just how I want them.

The issue is if I clone the repo anew(or work in my current repo) everything looks great....but when my co-devs delete their release branch and create a new one based off the new remote release I created, they still see all the old junk I tried to remove.

I feel this has to do with some local .git files mistaking the new branch release for the old release.

Any thoughts? Thanks.

1 Answer 1


So the branch is still synced to the local site. It needs to be reset to the commit in the remote. I think, ideally, what you would want to do...

$ git checkout release
$ git reset --hard origin/release
$ git checkout master
$ git reset --hard origin/master

Or... if they have everything locally pushed, they can just delete the local repo and clone again.

In the future, instead of rewriting history, it's normally easer to just revert those commits. You'll still see the history but the code won't be in HEAD of that branch.

  • Thank you, I think it was a local glitch of sorts. One dev didn't get the junk release code, the other fixed it somehow by doing this: 1)Clone repo 2)Create release branch in there 3)navigate back to original repo, all was good with release Seeing as how that doesn't make sense, it seems to be something was wrong with his specific local environment. Commented Oct 10, 2012 at 17:48

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.