SKV
SKV

Reputation: 284

synchronize a restored local copy of git repository

My hard drive crashed recently and I went back to a recent backup of all my data. However I had some changes in a local git repository that I had not committed before the failure. Now I want to bring everything back to where it was before the hard drive failure.

That is, I have a local copy of a folder that used to be connected to the git repository. However all the .git folders are missing. How can I synchronize the local copy with the repository, while keeping all the modifications that I had and did not commit to the repository?

Upvotes: 1

Views: 68

Answers (2)

amaslenn
amaslenn

Reputation: 805

If I understand you correctly, you have changed files without actual git commits. In this case you should just re-clone you remote repository and apply changes from your local folder to cloned repo. But all you commits (I mean git commits) are lost.

Upvotes: 0

VonC
VonC

Reputation: 1326686

you simply can:

  • clone you repo
  • overwrite its content with your backup local copy
  • ask git diff to display all the changes, add, and commit what you need to version.

Upvotes: 1

Related Questions