You can create a new branch and while creating it, you can select whichever commit you would like to select as the revisioın.
For example from main branch, you would like to go back to 5 commits earlier.
Version Control -> Manage branch lines -> New -> Revision (select the 5 steps earlier)
You can follow the steps Tolga mentioned, but you can also use the “Revert a Commit” button in “Version Control.”
Using Revert a Commit, you specifically select the commit you want to revert, and the application will show it as Changes (reverting the changes made in the commit). After that, you can make a new commit, which will be responsible for reverting the changes made in the commit selected in the previous step.
Well, I think you can do it via git itself. So inside your Mendix repository you can open a git terminal and try the following command to remove the latest 5 commits.
git reset --hard HEAD~5
git reset: The command to move the branch pointer.
--hard: This option discards all changes in your files, matching them to the state of the commit you are resetting to. Any uncommitted work will be lost.
HEAD~5: This tells Git to go back 5 commits from the current one (HEAD).
Your local repository is now reset to the state it was in before those 5 commits (version "0" in your example).