Results 1 to 16 of 16

Thread: Retrieving lost files

  1. #1

    Thread Starter
    PowerPoster Poppa Mintin's Avatar
    Join Date
    Mar 2009
    Location
    Skunthorpe, North Lincolnshire, England.
    Posts
    2,077

    Retrieving lost files

    Hi,

    I don't know how it's happened, but I've lost all my sources files for a project I've been working on.
    I have a folder for my VS source files, from which I usually run any project. If I decide to try to modify one, I copy it from that folder, paste it into another folder which I use for that purpose, and modify it from there, in this way I figure I can still run the unmodified app. while I'm working on the modification.
    When I'm happy with the re-worked project I replace the whole project back into the source files folder and delete the one in the other folder.

    I've just done that, but now I've thought of another little mod to make but I find that I only have the Project Name file, bin and Debug folders, everything else has gone.
    I don't know how that's happened, everything in the recycle bin is already deleted.

    Is there the slightest chance I could get it all back ?
    Or do I have to start from scratch again ?


    Poppa
    Along with the sunshine there has to be a little rain sometime.

  2. #2
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    107,143

    Re: Retrieving lost files

    This isn't really a VB issue because the type of files makes no difference to whether the OS can recover them. What I will say is that you should have been using source control in the first place, in which case this wouldn't be an issue in the first place and your whole process would be easier. Get a free Azure DevOps account or use GitHub or something and stop making your life harder for no reason.

  3. #3
    Fanatic Member
    Join Date
    Feb 2014
    Location
    Norfolk UK (inbred)
    Posts
    1,015

    Re: Retrieving lost files

    What you did is to nuke your backup....

    The rule is never copy, make backups that you NEVER touch and never go back to for anything other than reading.

    The problem is probably another user screw up, search your drive, you may have placed it somewhere else by mistake. A simple drag and drop can go wrong without the user knowing. 'Everything' by voidtools is useful utility for finding lost files quickly, Windows search cannot be relied upon to find anything.

    A better method for the future is to copy your folder, then rename it with a .1 or .2, .3 suffix, keeping those forever for future reference. It is a simple source code saving system. I never modify the old code once it is copied, it is there just in case other backup systems fail or a feck up on the part of the user. I have multiple copies of all my projects going back in time. They can easily be copied to USB.

    eg.
    source_folder
    source_folder.1
    source_folder.2
    source_folder.3
    .
    .
    .

    In addition a copy on dropbox and google drive is the equivalent of off-site backups.

  4. #4
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Location
    South Louisiana
    Posts
    10,323

    Re: Retrieving lost files

    I second JMcIlhinney. Consider this a learning lesson and utilize version control in the future.
    "Code is like humor. When you have to explain it, itís bad." - Cory House
    VbLessons | Code Tags | Sword of Fury - Jameram

  5. #5
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Location
    South Louisiana
    Posts
    10,323

    Re: Retrieving lost files

    Side note - I moved this to general pc.
    "Code is like humor. When you have to explain it, itís bad." - Cory House
    VbLessons | Code Tags | Sword of Fury - Jameram

  6. #6
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    107,143

    Re: Retrieving lost files

    For the record, source control will allow you to revert to any previous committed state - including before some or even all files were deleted - and branching is built right in. For instance, if you want to start work on a new feature then you can create a new branch for it. If you then need to fix a bug in the current version, you simply do that on the main branch and release the bug fix. When your new feature is finished, you can merge the feature branch into the main branch and release that as the new version, complete with the bug fix and the new feature. If you have made changes in the same area in both branches then the source control provider may not be able to merge that specific part automatically, but it will provide you with tools to help you do it manually.

  7. #7
    Administrator Steve R Jones's Avatar
    Join Date
    Apr 2012
    Location
    Largo, FL.
    Posts
    1,342

    Re: Retrieving lost files

    Superior file recovery
    Recuva can recover pictures, music, documents, videos, emails or any other file type youíve lost. And it can recover from any rewriteable media you have: memory cards, external hard drives, USB sticks and more!
    https://www.ccleaner.com/recuva

    One of the big keys is to STOP using the hard drive where the deleted files are located.... And in theory, you'd want to install RECUVA in a different system and move the drive in question to the other computer....

  8. #8
    Fanatic Member 2kaud's Avatar
    Join Date
    May 2014
    Location
    England
    Posts
    710

    Re: Retrieving lost files

    Is there the slightest chance I could get it all back ?
    This depends upon how much you value the lost programs, what you are prepared to pay for recovery - and what activity has happened on the computer since.

    There are specialist recovery companies who would probably be able to retrieve the data - provided the disk sectors used haven't been overwritten since. If you're thinking about going down this route, don't do anything else on the computer. Shut it down and leave until examined by the recovery company.

    Alternatively, if you want to try this yourself, there are some file recovery programs available that you use from a bootable linux usb that will attempt to recover data (or partial data).

    Sorry, I can't provide details.
    All advice is offered in good faith only. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/

    C++20 Compiler: Microsoft VS2019 (16.10.4)

  9. #9

    Thread Starter
    PowerPoster Poppa Mintin's Avatar
    Join Date
    Mar 2009
    Location
    Skunthorpe, North Lincolnshire, England.
    Posts
    2,077

    Re: Retrieving lost files

    Thanks guys...

    I'm going with the 'Do it all again' option.

    I shall look into source control, but it's the usual problem... Old dog, New tricks.


    Poppa
    Along with the sunshine there has to be a little rain sometime.

  10. #10
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Location
    South Louisiana
    Posts
    10,323

    Re: Retrieving lost files

    I shall look into source control, but it's the usual problem... Old dog, New tricks.
    Since you aren't really working collaboratively, you could just commit everything to your master branch.

    After you install Git BASH, open it in the directory your project solution is in, and run the following commands:
    Code:
    git init
    git config --global user.name "Your Name"
    git config --global user.email "youremail@yourdomain.com"
    git add .
    git commit -m "Initial commit."
    What this does is:
    1. Initialize the git repo
    2. Setup the name and email configurations (not really necessary, but you might as well)
    3. Add everything to the staging area
    4. Commit the changes in the staging area with the message "Initial comment."


    Then periodically (say when you finish a particular feature in your project), run the following commands:
    Code:
    git status
    git add .
    git commit -m "Some description of the feature that you just completed."
    What this does is:
    1. List the files that have changed since your previous commit
    2. Add everything to the staging area
    3. Commit the changes in the staging area with some descriptive message


    If at any point you wanted to see what changes you have committed, you'd run:
    Code:
    git log
    And if you needed to revert to a specific instance you can call the following where -commit hash- represents the commit hash from your log:
    Code:
    git revert -commit hash-
    -or-

    If you wanted to revert just your previous commit you can call the following:
    Code:
    git reset HEAD^ --hard
    "Code is like humor. When you have to explain it, itís bad." - Cory House
    VbLessons | Code Tags | Sword of Fury - Jameram

  11. #11
    Frenzied Member PlausiblyDamp's Avatar
    Join Date
    Dec 2016
    Location
    Newport, UK
    Posts
    1,430

    Re: Retrieving lost files

    Quote Originally Posted by Poppa Mintin View Post
    Thanks guys...

    I'm going with the 'Do it all again' option.

    I shall look into source control, but it's the usual problem... Old dog, New tricks.


    Poppa
    If you are using Visual Studio then git support has been built in for the last couple of versions, you can do all the routine version control stuff without ever leaving the IDE. The basics of Git don't take long to learn and once you are in the habit then you will never be losing changes - if you also get a free account with one of the online providers mentioned earlier by jmcilhinney then you are also protected against local system failures.

    Trust me, a decent version control system is so much easier than zip files, folder copies or other similar attempts to protect your code.

  12. #12
    Fanatic Member
    Join Date
    Feb 2014
    Location
    Norfolk UK (inbred)
    Posts
    1,015

    Re: Retrieving lost files

    The man's quite right.

  13. #13
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,001

    Re: Retrieving lost files

    There is of course also TFS.
    But that is mostly for company use.
    I don't know how it is compared to git because for better or for worse I'm plugging all my project to the company TFS.
    .

  14. #14
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    107,143

    Re: Retrieving lost files

    Quote Originally Posted by sapator View Post
    There is of course also TFS.
    But that is mostly for company use.
    I don't know how it is compared to git because for better or for worse I'm plugging all my project to the company TFS.
    The online version of TFS became Azure DevOps, which is Git-based. I'm not sure whether they have or are transitioning TFS to Git as well. There used to be a TFS Express but I'm not sure that that still exists. Full TFS is certainly overkill for a lone developer and I'm not sure it can be had for free anyway. I'd definitely recommend one of the free cloud providers, unless you have an issue with off-site storage.

  15. #15
    Frenzied Member PlausiblyDamp's Avatar
    Join Date
    Dec 2016
    Location
    Newport, UK
    Posts
    1,430

    Re: Retrieving lost files

    I always found TFVC a lot more confusing and complicated than git, plus it doesn't really have as many features as Git either.
    Even Microsoft themselves use Git internally so unless I was already using TFVC I can't really see any reason to start.

  16. #16
    Banned
    Join Date
    May 2021
    Posts
    3

    Re: Retrieving lost files

    You can use the network disk to back up, and only back up the changed files every day

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width