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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T02:50:53+00:00 2026-05-14T02:50:53+00:00

I have a commit, I have stored in a branch, because this should go

  • 0

I have a commit, I have stored in a branch, because this should go only to a specific box.

I have merged it to the branch master, but not the branch dev, that I use locally.

Now, by mistake I merged master to dev and that introduced this commit to dev.

I know can git revert sha, to branch dev; but since this is going to introduce a commit that undoes that commit (I am guessing, I haven’t exactly tried this), when I merge master, will this commit be undone too?

If so, how do I undo this commit only from the branch dev.

And oh, git reset HEAD^1 –hard is not an option because there are other commits on master, after the un-needed commit.

If reset back again and apply is the only option, then how do I only merge those extra commits from master other than the un-needed commit.

Update:

Here is the commit tree. Looks complex. I have pointed to the commit, that I don’t need in the dev. (I have also removed any personally identifiable information, thanks for understanding. It is so much simpler to screenshot gitk than to ascii art.)
alt text

Thanks in advance!

  • 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-14T02:50:54+00:00Added an answer on May 14, 2026 at 2:50 am

    On a scratch copy of your branch, git rebase --interactive and drop the unwanted commit. Alternatively, you could create a new branch upstream of the unwanted commit and git cherry-pick the desired commits onto it.

    There are probably more ways to achieve this.

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

Sidebar

Related Questions

I need to merge between dev and master frequently. I also have a commit
I have two PL/SQL Stored procedure each handling its own Transaction (Begin/Commit and Rollback
I'd like to have a commit message cleanup that will not necessarily remove lines
I have this setup where in my development copy I can commit changes on
I have a MSSSQL stored procedure performing a distributed transaction that looks like this:
Hi I have been trying this today and haven't had any luck. this stored
I have a local branch for day-to-day dev work in git. My workflow is:
I have datatype stored as blob (XML) in Oracle DB. I am retrieving this
I have this stored procedure CREATE PROCEDURE [dbo].[TestProcedure] @param1 int = 0 ,@param2 int
I have a stored procedure that has a BEGIN TRANSACTION and COMMIT TRANSACTION statement.

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.