0

I pulled from remote dev branch into my feature branch. And i have committed the code without looking into merge conflict , result is my feature branch fully overridden by dev branch .

Its already committed in to my local . Anyway to undo my pull & commit ??

trungduc
  • 11,926
  • 4
  • 31
  • 55
  • Sure. Step 1, create a new branch from your branch for backup. Step 2, study git interactive rebase, or maybe just git reset. In an emergency, reflog can help a lot, but it sounds like your case is not quite that bad. Git reset is probably enough, hard to say more without seeing your repo. But, rest assured, nothing was destroyed yet. – hyde Jun 21 '18 at 04:45
  • is a merge but no -m option was given. fatal: revert failed – ddwdwwf drewret Jun 21 '18 at 04:52
  • `git log --graph --abbrev-commit --oneline` and find your commit hash. Then reset hard on that commit `git reset --hard commithash` – Rajender Joshi Jun 21 '18 at 05:00
  • @hyde backup branch names ftw! – evolutionxbox Jun 21 '18 at 09:20

0 Answers0