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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T01:31:16+00:00 2026-06-05T01:31:16+00:00

I had a folder with ROR code lets call it subfolder under main folder

  • 0

I had a folder with ROR code lets call it “subfolder” under main folder call it “mainfolder”
I made a mistake and ran “git init subfolder” from the “main folder”
That command deleted most of the code there except the tmp, log and empty app directory

I further pulled from the git remote from the subfolder without realizing that the files got deleted

then touch readme

then add . then commit -m “first commit” that’s when I got files a message like

master 34f2e90] first commit
42 files changed, 84328 insertions(+)
create mode 100644 README
create mode 100644 log/development.log
create mode 100644 tmp/cache/assets/C7A/6A0/sprockets%2F442a717507a3dde80b7d59671208324c
create mode 100644 tmp/cache/assets/C9F/560/sprockets%2F8e5a9738e9bc15478e026d98335454f9
create mode 100644 tmp/cache/assets/CBF/380/sprockets%2F4f4c8476962893413bc66624ebedc372

Then

git push origin master

Counting objects: 127, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (85/85), done.
Writing objects: 100% (126/126), 389.53 KiB, done.
Total 126 (delta 14), reused 0 (delta 0)

Is there any way to recover those deleted files?

Thanks

  • 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-05T01:31:17+00:00Added an answer on June 5, 2026 at 1:31 am

    Git init does not delete files. It only adds a .git directory.

    You must have accidentally run another command to delete those files. Can you show the output of your shell “history” command for the commands surrounding this event?

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

Sidebar

Related Questions

I had made changes in a folder called branch, and now that its working
Currently I had 2 different schema set (setA/ and setB/) sitting under multicore/ folder
it had a existing git checkout and had made some modifications, then i checked
I have created a git repo in a folder that had spaces and some
Let 'Project/' be the main folder of the project. If for example I had
Well, I had a folder with icons, and yesterday I deleted it and cleaned
So for development purposes, we had our folder structure for our website something like
For one reason or another I had to empty folder in my subversion repository
I've recently had some trouble moving the location of the indexes folder (for the
Had a page that was working fine. Only change I made was to add

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.