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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T13:35:48+00:00 2026-05-24T13:35:48+00:00

I have just a master branch in my git repo. I commited a change

  • 0

I have just a master branch in my git repo. I commited a change to my file yesterday night:

git add filename
git commit -m 'my message'

This morning I was making some more changes that later I wanted to revert (I had not added these changes to the index, they were only in my filesystem). I had a look here and used the following command:

git checkout path/to/file/filename

Now I noticed that my las commit was gone. I did a search and found this, but it refers to git revert.

If I do git log, my last commit shows up there, but the changes in the file are not. And if I do git status I get no changes showing and “nothing added to commit” message.

Why did it revert my last commit? How do I re-apply the commit?

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-24T13:35:48+00:00Added an answer on May 24, 2026 at 1:35 pm

    If for whatever reason your commit from yesterday has disappeared, the first place to look for said commit is in the reflog.
    See for instance “how to undo a checkout in git?“

    git reflog
    git reset --hard <sha from reflog><
    

    You can even “Query git reflog for all commits to a specific file“.

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

Sidebar

Related Questions

We have currently just master branch. Our current workflow involves implementing the features locally,
I just did something terrible on a Git repo and I have no idea
in a git-svn repo, git status doesn't show the usual # On branch master
On my production server, I just have master always checked out. I do git
I have a heavily parallelized build across 45 slaves (one master that just handles
we have just started using a git account of our Django website project so
I have just started learning python version 3 and trying to create a file
I'm having problems getting hudson to checkout my git repo and merge into master.
I currently use git the following way: clone, fetch repo create topic branch for
I have forked an SVN project using Git because I needed to add features

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.