• @thebestaquaman@lemmy.world
        link
        fedilink
        154 months ago

        If you have set up your staging area for a commit you may want to discard (unstage) changes from the staging area, as opposed to discarding changes in the working directory.

        Of course, the difference between the two is obvious if you’re using git CLI, but I can easily see someone using a GUI (and that maybe isn’t too familiar with git) misunderstanding “discard” as “unstage”.

        Either way, what happened here indicates that all the files were somehow added to the VC, without having been committed first, or something like that, because git will not let you discard a file that is untracked, because that wouldn’t make any sense. The fact that the GUI let this person delete a bunch of files without first committing them to the index is what makes this a terrible design choice, and also what makes the use of the word “discard” misleading.

      • @Omega_Jimes@lemmy.ca
        link
        fedilink
        34 months ago

        Ok fair enough, but I’m under the impression these files existed before the source control was implemented.

        I guess it’s all up to how the program handles existing files.

    • stebo
      link
      fedilink
      54 months ago

      I’m pretty sure vscode shows a confirmation dialog when discarding changes will permanently delete a file. I’ve done that recently with temporary files that were no longer needed.

    • stebo
      link
      fedilink
      34 months ago

      the alternative to deleting is emptying the file contents, which is essentially the same…