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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T15:51:07+00:00 2026-05-14T15:51:07+00:00

I commited (not pushed) a lot of files locally (including binary files removing &

  • 0

I commited (not pushed) a lot of files locally (including binary files removing & adding…) and now when I try to push it takes a lot of time. Actually I messed up my local repo history.

How could I avoid this mistake in the future ? Can I transform a set of local revision 1->2->3->4 to 1->2 with 2 being the final revision of the local clone ?

edit: since I was in hurry I started a new remote repo from scratch with revision 4. In the future I will go with the marked answer as it seems easier but I will dig other solutions to see the truth. Thx for your support.

  • 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-14T15:51:08+00:00Added an answer on May 14, 2026 at 3:51 pm

    Mercurial history is immutable, you can’t delete using the normal tools. You can, however, create a new repo without those files:

    $ hg clone -r 1 repo-with-too-much new-repo
    

    that takes only revisions zero and one from the old repo and puts them into a new repo. Now copy the files from revision four into the new repo and commit.

    This gets rid of those interstitial changesets, but any repo you have out there in the wild still has them, so when you pull you’ll get them back.

    In general once you’ve pushed a changeset it’s out there and unless you can get everyone with a clone to delete it and reclone you’re out of luck.

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

Sidebar

Related Questions

A few minutes ago, I commited some files and then pushed them to my
I have locally commited severela times to a certain branch (called master-branch). Now i
Until now, if I ever commited and pushed something wrong to the master branch,
I just forget to applied permission of the files that I just recently commited,
User A commited and pushed File A to the repo incrementing the version to
I forked from a repository (upstream), then do my changes locally and push to
Once I have locally commited my code, doing either hg status or git status
I accidentally commited log/test.log but have never pushed it. I have since done a
I committed, but not pushed to repository, a file to a branch i.e. abc
Problem: edited files on windows, using git-bash, to fix IE7 problems committed, pushed to

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.