git destroyed my changes

Posted by mare on Stack Overflow See other posts from Stack Overflow or by mare
Published on 2010-06-07T19:36:12Z Indexed on 2010/06/07 19:42 UTC
Read the original article Hit count: 136

Filed under:
|

I made a commit of my repository a week ago but never actually pushed it to the remote at github, which I did today. However, in the time from my commit I made many changes to the source. But just the initial commit was pushed to remote and while doing it, it also overwrote my local files.

What can I do to get back my current files??

For better understanding, this is what I've done:

  1. Created new VS project and created a new git repository in it,
  2. Performed an initial scan, stage and commit but without adding a remote and performing a push,
  3. Worked on files for a week,
  4. (Today) Forgot to perform rescan, new stage and commit and just created new GitHub repository and performed this:

git remote add origin [email protected]:myaccount/webshop.git

git push origin master

  1. Now the files in GitHub repository are the ones from inital commit and those were also copied over my current files, so I'm in the initial commit stage now locally too, which is awful.

Help appreciated

© Stack Overflow or respective owner

Related posts about git

Related posts about github