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

  • Home
  • SEARCH
  • 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 9273733
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T16:10:59+00:00 2026-06-18T16:10:59+00:00

Lets say I have 3 git commits: Commit changes on sidebar Commit changes on

  • 0

Lets say I have 3 git commits:

  1. Commit changes on sidebar
  2. Commit changes on footer
  3. Commit changes on header

Now lets assume I have went trough spiritual awakening and realized that only changes I need is on the header and one the sidebar, the footer was fine and did not needed to be changed.

Is there a command that would do the following?:

  • merge commit#3 minus commit#2
  • delete commit#2
  • merge commit#3 plus commit#1

(or any other method that makes commit#2 as it never happened).

  • 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-06-18T16:11:01+00:00Added an answer on June 18, 2026 at 4:11 pm

    You can always just revert the changes from a single commit using git-revert.

    Given one or more existing commits, revert the changes that the related patches introduce, and record some new commits that record them. This requires your working tree to be clean (no modifications from the HEAD commit).

    Note: git revert is used to record some new commits to reverse the effect of some earlier commits (often only a faulty one). If you want to throw away all uncommitted changes in your working directory, you should see git-reset(1), particularly the --hard option. If you want to extract specific files as they were in another commit, you should see git-checkout(1), specifically the git checkout <commit> -- <filename> syntax. Take care with these alternatives as both will discard uncommitted changes in your working directory.

    So:

    git revert <commit-id-of-footer-changes>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

lets say I have a commit Id 0678dd19c498ede50e7714505eb5af3a5494beef I tried git log command, which
Let's say I have 2 commits in my git log. Now I want to
Let's say I have 3 unpushed commits. Now I want to change the commit
I have a question regarding git repository management. Lets say I want to create
Let's say I have multiple commits in my local git repository that have not
I have a current git repository at xp-dev.com, lets call it A. Now I
Lets say I have 2 unrelated projects (Talking about git), but due to my
I have a file, let's say file.txt I have done git mv file.txt to
Lets say have this immutable record type: public class Record { public Record(int x,
Lets say we have a table here, populated with the following data: acc_id1 acc_id2

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.