Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7069775
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:29:12+00:00 2026-05-28T05:29:12+00:00

Is there a way to convert a single commit (e.g. tip changeset in my

  • 0

Is there a way to convert a single commit (e.g. tip changeset in my local repository) to uncommitted changes in working directory?
I know that hg strip removes specified changeset(s) and backs it/them up, but does it convert those changesets to uncommited changes in working directory?

EDIT :

Concerning usage of hg rollback.

What if I have uncommitted changes before I want to do hg rollback? Do I have to commit those first? What about last several commits? Does sequential hg rollback stack up changes from those commits to existing uncommitted changes?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T05:29:13+00:00Added an answer on May 28, 2026 at 5:29 am

    If you’re trying to redo the last commit (perhaps with a better commit message, perhaps with a bug fixed) then you should now use

    $ hg commit --amend

    to update the last commit. That is much safer than using hg rollback as described below.

    If the commit is the last commit and you have not updated anywhere, then you can use hg rollback. Please read hg help rollback — is it a potentially destructive command.

    What it does: hg rollback will roll back the last transaction in your repository. Every time you hg commit, hg pull, hg unbundle, etc, you create a new transaction. When everything is stored safely, Mercurial closes the transaction. If something goes wrong in the middle of the transaction, Mercurial can recover (see hg recover). You can also manually roll back the last transaction with hg rollback. See hg rollback --dry-run for a preview of what the command will do.

    The rollback command wont touch your working copy. This means that files that showed up as modified before will appear modified again. So it’s easy to do

    $ hg commit -m "Fixed buug-123"
    

    Ups, typo in the commit message! Let’s fix that:

    $ hg rollback
    $ hg commit -m "Fixed bug-123"
    

    (Use hg commit --amend instead with Mercurial 2.2 and later.)

    The last commit message is also saved in .hg/last-message.txt so you can recover it from there if you don’t have it in your shell history.

    What if I have uncommited changes before I want to do hg rollback? Do I have to commit those first?

    Rollback doesn’t touch the working copy. This means that any additional changes in the working copy will appear together with the changes from the changeset. It’s as if you didn’t type hg commit at all.

    What about last several commits? Does sequential hg rollback stack up changes from those commits to existing uncommited changes?

    No, you only have one level of rollback since we only track the last transaction.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way to convert HTML into XAML? I noticed that you can
Is there a way to convert a single column record set such as 1
Is there any way to convert a bmp image to jpg/png without losing the
Is there a way to convert a HTML string into a Image .tiff file?
Is there a way to convert from System.Windows.Forms.HtmlElement to mshtml.IHTMLElemenet3? --edit after answer accepted
Is there a way to convert a multi page Tiff file to a jpeg
Is there a way to convert variable names to strings in javascript? To be
Is there any good way convert a binary (base 2) strings to integers in
Is there a way to convert a List(of Object) to a List(of String) in
Is there a way to convert an integer to a string in PHP?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.