2

I already made a project there, add, commit, push. Unfotunately, I've got power surgery :'(

When I've tried restart my PC, I cd back to my project folder, but suddenly it looks like these:

UserName@PC /c/xampp/htdocs/website

before UserName@PC /c/xampp/htdocs/website (master)

I tried git init and this showed up:

Reinitialized existing Git repository in c:/xampp/htdocs/website/.git/

but, nothing happen to my repo T__T

it still looks like these: UserName@PC /c/xampp/htdocs/website

Thank you very much, your guidance please t(^_^)

EDIT: I did git stash save before power surgery & this files comes up:

https://i.stack.imgur.com/bOB4F.jpg

mochadwi
  • 1,190
  • 9
  • 32
  • 87
  • 1
    Sometimes it is in hidden mode, so try to hide a folder once and unhide the folder again now you'll find the .git directory in the respected folder. – Suresh Laveti Apr 14 '18 at 09:21

2 Answers2

2

If you did push, you can try and:

  • clone again in another folder
  • check that it does look like /c/xampp/htdocs/otherfolder (master)
  • if it does, rename otherfolder to website, and go on working in that fresh clone
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • recently, I found that my `.git/index` & `.git/HEAD` file is corrupted after power surgery :'( Thank you for your advice sir, I though I would do a `git clone` but I didn't do much push either before >_< I stash every last my changed files and **bam**, I didn't remember the last time I did either `git commit` nor `git push` – mochadwi Sep 16 '14 at 12:26
  • 1
    @MochaD yes, small andfrequents commits are best practice, and would ensure that you don't find yourself in this pickle in the future. – VonC Sep 16 '14 at 12:32
  • yeah sir, I made much commit and try to minimize my doing. And try `git stash` to compare other branch much quicker, without have to `commit` first, or even twice `commit` with a tiny little changes ;'( I should try to search about this corruption, maybe I can find some solution! @VonC thank you very much sir! – mochadwi Sep 16 '14 at 12:48
  • yet, I can't voted up your answer, I just had this account a month ago :D and still had 12 reputation, because you voted up mine question :D – mochadwi Sep 16 '14 at 12:49
1

Use rd .git /S/Q before running the git init command.

Simas Joneliunas
  • 2,890
  • 20
  • 28
  • 35