git-recover | git-recover : recover deleted files in your repository | File Utils library
kandi X-RAY | git-recover Summary
kandi X-RAY | git-recover Summary
git-recover: recover deleted files in your repository.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of git-recover
git-recover Key Features
git-recover Examples and Code Snippets
Community Discussions
Trending Discussions on git-recover
QUESTION
I staged some changed and then did a hard reset on a repository, before doing the first commit. As a result, I lost many files. I'd like to recover those files.
I was told that by installing git-recover I could recover them. However, I'm having problems installing it. According to this, I should download the shell script and then add the file to the PATH variable. I did so, but I still get "'recover' is not a git command".
Any ideas about what I might be doing wrong?
...ANSWER
Answered 2019-May-23 at 04:53First it is a shell script, so it needs to be executed in a bash session (on Windows, a git bash
session)
Second, make sure the script is executable: chmod 755 git-recover
. That will ensure it is working within your PATH
.
QUESTION
What is behavior of git reset
, specifically git reset --hard
, while tree has no commits yet? (Just after git init
). It just deletes everything?
Messed it up, while editing .gitignore.
I tried to apply new changes to .gitignore, before making first commit. So, to ignore some new files, I had to clean index, and then make git add .
again. I guess, plain git reset
whouldn't do the mess, but I used git reset --hard
, due to my geniusness.
Now, the project folder contains only .git folder with contents, and also the whole folder structure of a project, but without any files. Why?
Can I recover the files? What are my options in this case?
UPD
@kowsky pointed me in right direction - in this answer they explain how to recover files, that are temporarily stored in .git/objects
(dangling blobs), like in my case (particularly, using this tool).
I recovered everything, thank you!
ANSWER
Answered 2018-Apr-11 at 11:35What is behavior of git reset, specifically
git reset --hard
, while tree has no commits yet?
If you add files and then use git reset --hard
, your files will be deleted. Untracked files won't be touched.
Can I recover the files?
If you never added or commited the files, git does not know anything about them and won't be able to recover them. All files that were added, however, can be recovered. Here and here are answers on how to recover them.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install git-recover
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page