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 6984185
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:31:00+00:00 2026-05-27T18:31:00+00:00

After my last commit I wrote a bunch of code. Before committing again, I

  • 0

After my last commit I wrote a bunch of code. Before committing again, I ran hg add.
It added some files I was not interested in, so I ran

$ hg revert --all

thinking that all the added files would go away. They did go away, but I also reverted all the code written since the last commit, which means a ton of work was lost! What are my options?

  • 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-27T18:31:01+00:00Added an answer on May 27, 2026 at 6:31 pm

    When you hg revert a file (or --all files), Mercurial saves a backup of the file under another name. This is to make it harder for you to lose work. If the file was called foo, you will have a foo.orig with the original version.

    You can use

    $ hg status --all --include "**.orig"
    

    to see all the .orig files in your working copy. Move the ones you need back, re-add them and commit.

    On a related note: people sometimes add the --no-backup flag to their [defaults] section in order to get rid of the .orig files Mercurial scatter around. I think this a really bad idea… just ignore the .orig files instead by adding

    syntax: glob
    *.orig
    

    to your .hgignore file. That’s much safer and one day you’ll be happy that you have these .orig file lying around 🙂

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

Sidebar

Related Questions

After the last commit, I modified a bunch of files in my working copy,
Since C# doesn't have a before,after,last,first etc. as part of its foreach. The challenge
After doing some work with Ruby, Rails, and RSpec last summer and I learned
I wanted to rollback to the last commit after making a massive error, but
After the last project I've done using WebForms, I've decided to pass on using
After my last, failed, attempt at asking a question here I'm trying a more
I want to get the characters after the last / in an url like
I am trying to append an image after the last input field in a
Ok, I'm now very confused. After my last question had several people comment about
After the you guys helped me out so gracefully last time, here is another

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.