0

I'm using Mercurial.

I've made a few errors with merging and so on, and just want to abandon all changes I have made (this includes changes committed locally, but never pushed).

How do I abandon everything and make my repo the same as the remote repo.

(ie see image, I want to discard those 5 queued up pushes)

*** note rollback only works on the (single) last transaction

*** my specific problem was that I had made changes to several different branches.

enter image description here

Ian G
  • 29,468
  • 21
  • 78
  • 92
  • 2
    See http://stackoverflow.com/a/6260667/1256452 (`hg strip`). Note that strip is a built-in extension in all modern Mercurial versions. – torek Sep 26 '16 at 22:26
  • Possible duplicate of [Mercurial undo last commit](http://stackoverflow.com/questions/4760684/mercurial-undo-last-commit) – StayOnTarget Sep 28 '16 at 02:25

1 Answers1

0

In the end I cloned the repo to a new folder

hg clone https://www.mercurial-scm.org/repo mercurial-repo

and then I deleted my old .hg folder and replaced it with a known good one from the origin.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Ian G
  • 29,468
  • 21
  • 78
  • 92