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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T15:09:50+00:00 2026-06-09T15:09:50+00:00

I had a branch dev and a branch cutting-edge. I had a commit with

  • 0

I had a branch dev and a branch cutting-edge.

I had a commit with SHA1 id say 4356xyz on dev. I wanted that to be on cutting-edge. So I checked out cutting-edge and did

git reset --hard 4356xyz

Now when I do git log I see that history of both the branches have become same.
Is there a way by which I can recover the previous history of cutting-edge branch before I did the reset?

  • 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-09T15:09:52+00:00Added an answer on June 9, 2026 at 3:09 pm

    git reset --hard 4356xyz took your cutting-edge branch and pointed it at that commit. If that was the same commit that dev was pointing at, then yes, they will share the same history because they are now pointing at the same commit.

    You can inspect git reflog to figure out what your branch cutting-edge pointed to before you told get to point it at commit 4356xyz.

    In the future, if you want to add commits from one branch onto another, you need to either merge your branches, or cherry-pick specific commits.

    To pull just commit 4356xyz, you would git checkout cutting-edge and then git cherry-pick 4356xyz.

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

Sidebar

Related Questions

I had a private branch that I did a ton of commits to, then
I remember reading a blog post about a group that had taken a branch
I had a local topic branch based off a remote branch on the git
I had made changes in a folder called branch, and now that its working
I had a lot of local changes. I just accidentally did git merge another_branch
I had a working iOS project, and whilst working on a git branch, the
Today I had to work with a remote branch called origin/}__test_syntax_error_in_simpack_settings . I wanted
I have a local branch for day-to-day dev work in git. My workflow is:
I was trying to merge a dev branch into master. git checkout master git
I had recently stumbled upon a common problem in Git when creating branch groups:

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.