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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T01:22:30+00:00 2026-06-11T01:22:30+00:00

A local branch:- ‘feature/100’ And Remote branches:- ‘master’ ‘Version2’ Accidently, I have merged my

  • 0

A local branch:-

‘feature/100’

And Remote branches:-

‘master’

‘Version2’

Accidently,

  1. I have merged my feature branch ‘feature/100’ to the master
  2. Also pushed it to the remote repository.

But in real ‘feature/100‘ should have been merged into remote branch ‘Version2‘

How I fixed it (partially):-

i have merged the feature branch ‘feature/100‘ to the remote branch ‘Version2‘ and pushed it to the server.

git checkout Version2
git merge --squash feature/100
git add .
git commit -m 'New message'

But I want to delete the last push I have merged and commit to the master branch. How?

Side Note I am only one working on this project.. So even if pushed commit is deleted it won’t harm anyone else

  • 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-11T01:22:32+00:00Added an answer on June 11, 2026 at 1:22 am

    You can either:

    Revert your change

    git revert HEAD

    This will create a new commit that reverts the changes that you just pushed up to master. This is the safest option because other people may have already pulled down the change that you have pushed up.

    Change your commit history and force push the change

    You can remove the commit that you just pushed up with:

    git reset --hard HEAD~1

    git push origin master --force

    You don’t want to do this unless you’re absolutely sure that no one has pulled down your changes from master.

    For more info, see Delete commits from a branch in Git

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

Sidebar

Related Questions

A local branch:- 'feature/100' And Remote branches:- 'master' 'Version2' Accidently, I have merged my
I have two branches: local branch (the one which I work with) remote branch
I have a local branch tracking the remote/master branch. After running git-pull and git-log
I have a local branch named ' my_local_branch ', which tracks a remote branch
Most examples of creating remote branches involve pushing from a local branch Is there
Lets say I have the following two branches and the local branch is 'mybranch'
I have a local branch that is tracking of a remote branch on git.
I have a local branch A that's branched from origin/master that I frequently rebase,
I needed to have a local branch pulling and pushing to a remote branch
I have forgot to create local branch and was working with remote. After making

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.