diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -2099,10 +2099,11 @@
         return result
 
     def _bisecttests(self, tests):
-        bisectcmd = ['hg', 'bisect']
+        hgcmd = ['hg']
         bisectrepo = self._runner.options.bisect_repo
         if bisectrepo:
-            bisectcmd.extend(['-R', os.path.abspath(bisectrepo)])
+            hgcmd.extend(['-R', os.path.abspath(bisectrepo)])
+        bisectcmd = hgcmd + ['bisect']
         def pread(args):
             env = os.environ.copy()
             env['HGPLAIN'] = '1'
@@ -2111,34 +2112,45 @@
             data = p.stdout.read()
             p.wait()
             return data
+        orignode = pread(hgcmd + ['id', '--debug'])[:21]
+        if orignode.endswith('+'):
+            self.stream.writeln('skipping bisect: uncommitted changes')
+            return
+        orignode = orignode[:20]
+        if len(orignode) != 20:
+            self.stream.writeln('skipping bisect: unknown node')
+            return
         for test in tests:
-            pread(bisectcmd + ['--reset']),
-            pread(bisectcmd + ['--bad', '.'])
-            pread(bisectcmd + ['--good',
-                      self._runner.options.known_good_rev])
-            # TODO: we probably need to forward more options
-            # that alter hg's behavior inside the tests.
-            opts = ''
-            withhg = self._runner.options.with_hg
-            if withhg:
-                opts += ' --with-hg=%s ' % shellquote(_strpath(withhg))
-            rtc = '%s %s %s %s' % (sys.executable, sys.argv[0], opts,
-                                   test)
-            data = pread(bisectcmd + ['--command', rtc])
-            m = re.search(
-                (br'\nThe first (?P<goodbad>bad|good) revision '
-                 br'is:\nchangeset: +\d+:(?P<node>[a-f0-9]+)\n.*\n'
-                 br'summary: +(?P<summary>[^\n]+)\n'),
-                data, (re.MULTILINE | re.DOTALL))
-            if m is None:
+            try:
+                pread(bisectcmd + ['--reset']),
+                pread(bisectcmd + ['--bad', '.'])
+                pread(bisectcmd + ['--good',
+                          self._runner.options.known_good_rev])
+                # TODO: we probably need to forward more options
+                # that alter hg's behavior inside the tests.
+                opts = ''
+                withhg = self._runner.options.with_hg
+                if withhg:
+                    opts += ' --with-hg=%s ' % shellquote(_strpath(withhg))
+                rtc = '%s %s %s %s' % (sys.executable, sys.argv[0], opts,
+                                       test)
+                data = pread(bisectcmd + ['--command', rtc])
+                m = re.search(
+                    (br'\nThe first (?P<goodbad>bad|good) revision '
+                     br'is:\nchangeset: +\d+:(?P<node>[a-f0-9]+)\n.*\n'
+                     br'summary: +(?P<summary>[^\n]+)\n'),
+                    data, (re.MULTILINE | re.DOTALL))
+                if m is None:
+                    self.stream.writeln(
+                        'Failed to identify failure point for %s' % test)
+                    continue
+                dat = m.groupdict()
+                verb = 'broken' if dat['goodbad'] == 'bad' else 'fixed'
                 self.stream.writeln(
-                    'Failed to identify failure point for %s' % test)
-                continue
-            dat = m.groupdict()
-            verb = 'broken' if dat['goodbad'] == 'bad' else 'fixed'
-            self.stream.writeln(
-                '%s %s by %s (%s)' % (
-                    test, verb, dat['node'], dat['summary']))
+                    '%s %s by %s (%s)' % (
+                        test, verb, dat['node'], dat['summary']))
+            finally:
+                pread(hgcmd + ['update', '-C', orignode])
 
     def printtimes(self, times):
         # iolock held by run
diff --git a/tests/test-run-tests.t b/tests/test-run-tests.t
--- a/tests/test-run-tests.t
+++ b/tests/test-run-tests.t
@@ -1277,6 +1277,8 @@
   >   fail
   > EOF
   $ hg ci -m 'bad'
+  $ echo 'unrelated' > unrelated
+  $ hg ci -m 'unrelated' -A unrelated
   $ rt --known-good-rev=0 test-bisect.t
   
   --- $TESTTMP/anothertests/bisect/test-bisect.t
@@ -1296,6 +1298,9 @@
   python hash seed: * (glob)
   [1]
 
+  $ hg id -R ../bisect
+  020d1494060d tip
+
   $ cd ..
 
 support bisecting a separate repo
@@ -1348,6 +1353,9 @@
   python hash seed: * (glob)
   [1]
 
+  $ hg id -R ../bisect
+  020d1494060d tip
+
   $ cd ..
 
 Test a broken #if statement doesn't break run-tests threading.