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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T18:20:04+00:00 2026-06-10T18:20:04+00:00

I made a commit while on the (no branch) branch then did a pull,

  • 0

I made a commit while on the (no branch) branch then did a pull, realized I was on the wrong branch and did a ‘checkout master’ and another pull. I now can’t find my original commit to push on the master branch and I can’t switch to the (no branch). Is there a way to resurrect my commit or get the diff?

  • 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-10T18:20:06+00:00Added an answer on June 10, 2026 at 6:20 pm

    The git reflog will list for you all the commits you did, and a (for instance) git merge HEAD@{1} will merge it back into your branch.

    $ git reflog
    734713b... HEAD@{0}: commit: fixed refs handling, added gc auto, updated
    d921970... HEAD@{1}: merge phedders/rdocs: Merge made by recursive.
    1c002dd... HEAD@{2}: commit: added some blame and merge stuff
    

    From git rev-parse:

    <refname>@{<n>}, e.g. master@{1}
    

    A ref followed by the suffix @ with an ordinal specification enclosed in a brace pair (e.g. {1}, {15}) specifies the n-th prior value of that ref.

    Note that a git rebase -i would do the same.

    The Revision Selection page mentions:

    It’s important to note that the reflog information is strictly local — it’s a log of what you’ve done in your repository.
    The references won’t be the same on someone else’s copy of the repository; and right after you initially clone a repository, you’ll have an empty reflog, as no activity has occurred yet in your repository.

    The config gc.reflogExpire specifies when to removes reflog entries older than this time; defaults to 90 days.

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

Sidebar

Related Questions

I have a master branch that was branched from by another dev, who then
While working on Master branch, I forgot to create new branch. Made changes to
So I first forked a repo and then made a commit to that forked
I made 5 commits to Master branch when bug hunting on a private project
I started a feature branch B from branch A. Then I made some changes
While trying to revert a commit I made to my repository of my .emacs.d
I cloned a git repo and then started playing around in its master branch.
I made a mistake and accidentally was committing to master for a while, and
I made a mistake when I rebase to a recent commit. ( I forgot
I made an error when I was working and wound up with a commit

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.