How to restore a project if I only have a .git folder?

How to restore my project? I save only the /.git folder and now you need to restore the project from this folder.

+4
source share
1 answer

1. If you previously transferred files to git:

Try to do it first git log. Then you will see the commits. If you see a commit that makes sense, you can do it git checkout <HASH>. Where the Hash is the commit hash.

Then check if your files are coming out.

2. If you did not specify only local changes :

You can do git statusto see the changes. A will git stashtemporarily suspend these changes and git stash popwill reapply the changes.

: GIT

git reset --HARD <HASH>, git push -f, , , .

git revert <HASH>, a git push. GIT . git push -f - , , .

+3

Source: https://habr.com/ru/post/1649642/


All Articles