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

  • Home
  • SEARCH
  • 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 7083983
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:14:44+00:00 2026-05-28T07:14:44+00:00

I messed up with git after running git reset –hard HEAD~3 and lost 2

  • 0

I messed up with git after running git reset --hard HEAD~3 and lost 2 hours worth of work. I then found a post on here that explained git reflog.

When I want to return to “git reset HEAD@{1}“, how do I not only return, but have all files that were removed put back in their directories?

  • 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-28T07:14:44+00:00Added an answer on May 28, 2026 at 7:14 am

    You will need to move the branch that you want to be at that point with

    git branch -f master HEAD

    The above example moves the branch master to HEAD. So it requires HEAD to be at the point you want to move the branch to. If that isn’t the case you can use the commit hash or reflog entry instead of HEAD.

    If you never commited the files before the --hard reset, the work is gone. Git will only be able to recover what you commited.

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

Sidebar

Related Questions

After I messed up the description of my previous post on this I have
After having converted a messed up XML using regex, I now need to change
I've created git repository, added code and pushed it to GitHub. Then locally, I've
I'm trying to get a git commit email hook running using Git on Windows.
I was doing some work at home over the weekend and used git to
This MESSED ME UP hard. I thought i was setting the key but i
My git commits are a bit messed up and I was wondering if I
When I do git log in certain places the output is messed up and
Everything messed up in my head. enum, NSObject, custom interface and so on... All
I messed some config files up and need to get so that my git

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.