Welcome to the world of version control. Git is an amazing and powerful tool, but it can take some getting used to.
I would suggest you take a step back from the specifics of your project (or even MATLAB) and just start with some Git (or even version control) basics.
The first basic is that if you find yourself copying an entire folder for a release, you are probably not using Git to it's full advantage. If you are a developer working alone on a project, you can still heavily benefit from Git without ever branching or copying your folder. I assume you've done this already, but start by creating a Git respository in your code directory, then checking in all the files. My suggestion would be to start with the latest release, check that code into Git, then immediately tag the current state (using git tag). By tagging this state, you can always restore your current working directory back to that state using git checkout). There is no need to manually make a copy of the folder. As long as you've committed any changes into Git, you can always use git checkout to switch to any other version of your files, all within the same directory.
As you work, whenever you complete a small chunk of work (it is up to you to decide what "small" and "chunk of work" mean), check that into Git. Every time you call "git commit" the code you've submitted is given a unique label, allowing you to restore that state. Git tag is just a way to give a friendly name (rather than a long and complicated automatically generated name). Once you are ready for a new release, use git tag again to name that specific version of the code.
The only reason to have two separate folders with to different copies of your code is if you want to be able to run two versions of your code at the same time (or perhaps open them side-by-side, but there are ways to do that in git as well). However, once your code is in Git, you shouldn't be copy/pasting an entire folder any more. You should be using "git clone", "git push", and "git pull" (and "git fetch") to create a clone of one directory into another directory. This isn't required, but this will work best if you pick a hosting service (like GitHub or GitLab), and then each copy of your code can synchronize with that server.
Once you've got those basics down, there are a few reasons to branch, such as:
- You want to work on two independent features. You can create a branch for each feature, and then when the feature is done you can merge it back into the main branch.
- You want to apply bug fixes to a past release, without incorporating all the new features into the past release. You create a branch based on the release (you can create a new branch from a git tag), and apply the fix to just that branch.
- You are working in a team.
When you get to that point, you may want to look at some online articles and tutorials regarding different branching models for Git. There are a ton of different articles (and opinions) on this topic. I did some very very quick Google searching using search terms like "git branching models" or "git branching strategies" (and I am not endorcing any of these specific models), but to give you some specific examples of what I mean, here are some links:
This isn't required, but my personal recommendation would be to learn the command line versions of all of the above first, get a good solid understanding of how Git works and what it means to commit, branch, tag, merge, rebase, push, and pull. Once you've done that, you can start leveraging the tools built-in to MATLAB to make your life easier, but it will be easier to understand those tools if you've learned the command line versions.
I hope that helps get you started!