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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T05:03:29+00:00 2026-05-19T05:03:29+00:00

I don’t really know what I’ve just done so I’m just going to give

  • 0

I don’t really know what I’ve just done so I’m just going to give a kind of timeline.

I was trying to set up a gitHub repository today for the first time. I have a folder where I keep all the files from my site and it had a .git folder. Every so often I was committing changes etc and everything seemed ok.

Today I tried to merge two branches of the project I was working on. I tried “merge” and “rebase” commands but I couldn’t really understand what was happening or what I was doing so I decided I’d just start over with git.

I pulled the .git folder out of my website folder (I didn’t delete it which I guess could be my saving grace here). Did a new git Init in the folder and committed the website files to it.

That’s when I noticed loads of files were missing. I think they’re still in the first .git folder. Is there a way I can restore a directory from this folder?

  • 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-19T05:03:30+00:00Added an answer on May 19, 2026 at 5:03 am

    I’m surprised that you’ve been working for two months with git and decided that starting over was that best way to recover from a failed rebase, it should be a lot easier.

    You should be able to recover your old commits into the new repository without too many problems.

    You can add a new remote that is your old saved repository:

    git remote add old /path/to/old/saved/.git
    

    Then you can fetch all of the old history.

    git fetch old
    

    Then you can open up a history browser (e.g. gitk --all) to have a look at the old history.

    You can check out versions of missing files with a command such as:

    git checkout old/master -- path/to/missing/file
    

    The old/master refers to the master branch in your old repository, you can use the id of any branch or commit here, though.

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

Sidebar

Related Questions

don't know if the title describes anything about what I'm trying to say but
Don't really know how to formulate the title, but it should be pretty obvious
Don't know how to explain it better but i'm trying to get a response
Don't know whats exactly going on, but it's definitely killing my time for nothing.
Don't know whether I'm having a "thick day" - but I just wondered what
Don't know if I'm over-thinking this or not.. but I'm trying to be able
Don't know a better title but here is what im trying to do. I
don't know what happened in my jcrop selection. I think I pressed some keys
Don't be scared of the extensive code. The problem is general. I just provided
Don't know how to google for such, but is there a way to query

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.