Git removed/deleted all of my files from desktop #1001
Comments
@Hiram-Abiff, I'm not certain there's a way to get your changes back but seeing how the .git repo is very large, I wonder if you probably deleted all your files on your desktop folder using the github package. Only way I can see this happening is if you selected all files in We have a undo/redo feature, but from my observation, once you close atom and open back up that button disappears. /cc @kuychaco do you know if there's a way from command line to get back files that were deleted by discarding changes through the UI then closing Atom? It seems that in Atom once you close and open atom back up the Although based on your scenario, I'm only making an assumption you clicked see https://git-scm.com/docs/gittutorial for more info on git. |
@Hiram-Abiff Sorry to hear about your troubles. 😟 As @ungb mentioned, this should only have happened when doing
The guide below maybe helps, but I only tried it on macOS. For Windows or Linux it might be different. Also before running some commands, it's probably a good idea to first backup your Desktop or make a copy of If you look inside the If so, you can try the following:
Then under Unfortunately, the file names are gone, but at least you can get the files back. Might be hard to sort through and rename them if there are 100s of files. Once you recovered all files, you can delete |
@Hiram-Abiff I'm going to close this issue, but please reopen this issue if you see an actual issue and can give a consistent repro on the issue. I attempted the scenario on mac and windows where I follow what you did. The files still there unless I click |
Yeah, I second what @ungb says about the only way I can imagine this happening is if all your files were selected in the git panel and "discard changes" was selected in the context menu. Pinging @smashwilson for his knowledge of the inner workings of "Create Repository" in case anything comes to mind |
Hmm, nothing comes to mind... "Create Repository" just shells out to |
Finally getting around to adding this report from Halp:
Another user ran into this and playing around with it, and I did find another similar way to do this but without having to select all the files in
So without specifically selecting all files and selecting "Discard Changes", you can lose your files (assuming you close Atom so can no longer "Undo Discard"). Even though things are still working as expected, the feedback is that's it's relatively easy to lose a project if you're not super familiar with Git/GitHub. |
I'm open to dropping "Discard all changes" from the context menu. If that's really what you want, you can select them all and discard. |
At the Mini Summit somebody ( @maxbrunsfeld? ) had the idea that "Discard all changes" would only discard modified files, but not added files. So the "Discard all changes" would have no effect in this situation. And when you right-click on an added file, instead of saying "Discard Changes", it would say "Delete File" or "Move to Trash" to make it more clear that the file will be gone. Tower does the ☝️ above behaviour. |
I agree entirely with simurai; that suggestion would have saved me from
loosing everything. In my own opinion, the current system is a trap for
unaware users.
…On Thu, Aug 3, 2017 at 2:05 PM, simurai ***@***.***> wrote:
At the Mini Summit somebody ( @maxbrunsfeld
<https://github.com/maxbrunsfeld>? ) had the idea that "Discard all
changes" would only discard *modified* files, but not *added* files. So
the "Discard all changes" would have no effect in this situation.
And when you right-click on an added file, instead of saying "Discard
Changes", it would say "Delete File" or "Move to Trash" to make it more
clear that the file will be gone.
Tower does the ☝️ above behaviour.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1001 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AYvOVyurSMaDosuaYWgP9qu3byMoXGPRks5sUjYrgaJpZM4OLxL2>
.
|
yh, just fallen foul of this as a newbie to git. desktop deleted. huff. |
Sorry about that @technopian - did you perform the same steps as I described above in #1001 (comment)? If so, is |
hi and thanks for reply - i did indeed try the tips mentioned to no avail. lives & learns, but where's the software's prior prompting/first install mention of risk? yes, accepted, t'was my fault ultimately, but this particular software i definitely expected to be in safe hands, not dangled over a precipice on first use. software designed to ensure proper control of all files, makes for super simple deletion without impact being well communicated. seems bunk to me. |
@simurai I have unfortunately also fallen into this predicament and I am stuck on how to get out. I accidentally click discard changes for all the files on my desktop, but there is a transparent .git folder on my desktop with the files you mentioned. Problem is that all the files seem unreadable. Do you have any advice on how to recover them from this folder? I'm using windows btw. |
Not sure about windows. Is it possible to move the files? Or copy them to a different place? Maybe it's unreadable because it's in the |
Sorry, forgot to mention here - @cleung30 reached out over email and was able to recover their files (though without the file names and extensions). They did mention that I wasn't able to reproduce, but @cleung30 if you can reproduce that behavior with some test repository, feel free to open a new issue with the template filled out so we can take a look. |
@simurai thank you for your response. I was able to recover the files like @rsese mentioned. but with no name or file type. @rsese maybe try adding something to "unstaged" , discard changes, and then close atom. I've included a very useful article that i've included below and definitely would have saved 14 hours of trying to ifnd the answer online. https://medium.com/@CarrieGuss/how-to-recover-from-a-git-hard-reset-b830b5e3f60c |
Ouch! This issue just bit me hard. I must of somehow hit a hot-key combination because my project directory just deleted everything I had in |
Ugh sorry about that @bugs181 - it seems like the exact sequence of steps aren't clear but just to confirm, do you happen to have repro steps? Or do you remember if https://flight-manual.atom.io/using-atom/sections/github-package/#discard-changes |
I don't have the minute details of the repro steps but can try to connect the dots. Platform: OSX 10.14 Had nearly a week of work in ProjectName (and luckily for me I had backups of this directory).
For step 5. I was trying to white-list specific directories from |
I was just orienting myself with Git and Github today and I deleted essentially all the files I had in the folder. I had no clue what I was doing and didn't even realize the files were gone until it was too late. This is not a good button and it makes it even harder to orient yourself with a software. |
Try branch_name is denoted by a hexadecimal number, you will need to enter that particular number. hope it helps. |
I ran into the same problem as other users in which I accidentally deleted changes in atom. I tried running git fsck but command prompt does not recognize git and it does not work. Is there anything else I can do? I am using Windows |
HELP! :'( Hello, I am very very new to coding and using Git. I can't find an email to contact git, so I'm hoping this helps. If not should I take my device to GeekSquad? Like I said I'm new to this world and it's giving me a beat down. |
Thankyou so much |
I accidentally (without fully understanding what I was doing) clicked the "Create Repository" button while viewing my projects, and a git was created on my desktop. Because I had no idea how a git was used with Atom, I thought I was simply going to link Atom to an already created git. Of course, this was my fault for not reading what it said directly above the button "Initialize this project directory with a git repository"... I got way to ahead of myself, and didn't understand the possible dangers or what it meant.
After Atom tried to add everything on my desktop to the unstaged changes list, I clicked out of atom; this is when I noticed that every file on my desktop was gone, and the only thing in its place was a .git folder. I lost pictures, project files, scripts and pieces of software that was on my desktop..
The git (as far as I'm aware, as I am new to using git), did not push my content to an online repo; but then again, where are all my files then? They should have still been left untouched on my desktop, shouldn't they? But they're all gone. Is it possible the files have been uploaded somewhere? or were they deleted?
The .git folder contains about 1.75GB of content.
After opening Atom again, the files that were on my desktop and were previously shown in Atom are no longer shown anywhere under the git bars or in the project view. The only files shown are leftover folders in white, and 1 is green (a .exe that starts with the pc, so it couldn't be parsed)..
If there are any suggestions that can help me out and recover my files, I'd very very much appreciate it.
Btw, I highly recommend the git creation feature be removed/or at least relocated or improved. I can see linking an already created git, but what Atom did was completely unnecessary and should not have happened with a single click. There should be two buttons at least, one that includes "find git repository folder" and or "Create Repository". But, there should always be a warning or notice first asking if your sure you want to create the git in that location, with the locations name listed in a pop up window... I didn't even realize what directory it was going to be created in until after the fact.
And yes, I understand this primarily occurred because of my lack of knowledge in Github or Atom, but it was all too easy for what happened to actually happen anyways. and I believe more safety precautions need to be in place for people like myself. I lost a lot of content, pics, project files, text documents... a lot of stuff that I thought was somewhat safe on my desktop.
Again, I thank anyone who can help me recover my files; months of work has just disappeared, and I am lost now.
The text was updated successfully, but these errors were encountered: