How to set up the VCS will depend on which VCS you choose - and won't have anything to do with STM32CubeIDE.
Or are you really asking how to integrate a VCS into STM32CubeIDE ?
@David_ wrote:
How Version Control System works? How often it freeze and save files/state of a project? Does it restore to (a) hit 'commit' key (b) nth compile in past (c) at any time in past?
None of these has anything to do with STM32CubeIDE - it will be all down to the VCS you choose, how you choose to configure it, and/or how you choose to use it.
Some general articles on Version Control:
https://en.wikipedia.org/wiki/Version_control
https://www.perforce.com/blog/vcs/what-is-version-control
https://www.atlassian.com/git/tutorials/what-is-version-control
https://git-scm.com/book/en/v2/Getting-Started-About-Version-Control
EDIT:
Note that a VCS doesn't need to be integrated with an IDE - any IDE - for you to use it on your projects.