admin管理员组文章数量:1400674
Is it possible to get my files back? Knowing thay they were overwritten due to the clone, and I couldn't push it before. The commits I made earlier seemed to be taken into account but I have no traces of it.
I recently created a streamlit application running with a github repository.
I had an older version of the code in my repository and I wanted to update it with a newer version I had locally in a folder. So I linked my folder with my repository, and then I wanted to commit changes and then I tried to push it but it didn't work cause of many problems.
So, as I am new concerning github. I decided to ask ChatGPT (probably worst decision) and it ended up telling me to clone the older repo from github into my folder, so all of my files were overwritten with the older ones.
Is it possible to get my files back? Knowing thay they were overwritten due to the clone, and I couldn't push it before. The commits I made earlier seemed to be taken into account but I have no traces of it.
I recently created a streamlit application running with a github repository.
I had an older version of the code in my repository and I wanted to update it with a newer version I had locally in a folder. So I linked my folder with my repository, and then I wanted to commit changes and then I tried to push it but it didn't work cause of many problems.
So, as I am new concerning github. I decided to ask ChatGPT (probably worst decision) and it ended up telling me to clone the older repo from github into my folder, so all of my files were overwritten with the older ones.
Share Improve this question edited Mar 25 at 15:20 mkrieger1 23.5k7 gold badges64 silver badges82 bronze badges asked Mar 25 at 15:16 Jean BériotJean Bériot 131 silver badge1 bronze badge 2- You can restore anything which you have included in any commit. Otherwise, only with luck. – mkrieger1 Commented Mar 25 at 15:19
- Luck or filesystem backups. – Jim Redmond Commented Mar 25 at 21:05
1 Answer
Reset to default 1If you had already committed your changes, it is likely that they remain in the git database (inside the .git
folder).
To find them, you can use git log --graph --reflog
.
It will show a tree of commits, sorted by the date.
Once you find the hash of the commit you want, use git checkout
to update the working tree to it.
本文标签:
版权声明:本文标题:git - Accidentally cloned an older version of my code from my repo to my updated folder. Is it possible to restore my files? - S 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744186536a2594315.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论