1

me and my partner are working on a project. we have a release branch. From this we checked out our feature branch.

TO work on parallel we created 2 more branches from the feature branch. one for me and the other for y partner.

The issue: By mistake I have committed the changes of my private branch and merged it to feature branch without testing. I want to undo my changes on the feature branch? is it possible?

Solutions tried: i tried "git reset HEAD~1" , but it is not reflecting on the bitbucket gui.

inlineMacro
  • 69
  • 1
  • 7
  • 1
    Go to branch you want to "repair", run `git reset --hard {commit}` then `git push --force` – Héctor Jun 25 '18 at 10:02
  • Possible duplicate of [How to undo the most recent commits in Git?](https://stackoverflow.com/questions/927358/how-to-undo-the-most-recent-commits-in-git) – phd Jun 25 '18 at 12:22
  • 1
    Have you solved the problem by using `git push -f` after the command `git reset --hard HEAD~1`? – Marina Liu Jun 26 '18 at 08:56
  • If your problem has been solved, you can mark the answer. And it will also benefit others who meet similar questions. – Marina Liu Jul 02 '18 at 03:39

1 Answers1

1

After doing the reset, see if you are at right commit using git log. Then just force push it using git push -u origin master -f

Varun Garg
  • 2,464
  • 23
  • 37