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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T22:00:24+00:00 2026-06-11T22:00:24+00:00

Steps I performed: I have two branches branch1 and branch2, $git branch –Initial state

  • 0

Steps I performed:

I have two branches branch1 and branch2,

$git branch --Initial state
$branch1

$git checkout branch2
$git pull origin branch1 --Step1

I resolve the conflicts and did a

$git commit -m "Merge resolved"

then

$git checkout branch1
$git merge branch2
$git push origin branch1

Now I realised that while being at step1, the auto merging removed some code and the change code was pushed. Now I want to go back to my initial state in order to revert any changes. Looking for some immediate help?

  • 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-11T22:00:26+00:00Added an answer on June 11, 2026 at 10:00 pm

    You can revert the merge following the official guide, however this leaves Git with the erroneous belief that the merged commits are still on the target branch.

    Basically you have to :

    git revert -m 1 (Commit id of the merge commit)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So, I have perform two steps a) Create a some random xml file in
Here are my steps: switch from trunk to my branch perform a merge from
User registration in my application is performed in steps. After submitting the form, some
I just started using explicit resource files. I performed these steps: In the root
Consider I have two tables, t1 and t2 t1 = (id, name), t2 =
I have an application that has two buttons, and I want to detect when
So we have two automated processes on our build system. The first performs an
I have two tables that i am inserting records into. I am using PHP
I'm going to test a complex scenario which expects several other steps to have
I have a simple method that just takes two managed object IDs, pulls the

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.