Instead, use version control software, like git.
Some developers leave blocks of commented-out code. Maybe that’s the previous version of the code, or maybe it’s the future version. In worse cases, multiple versions are commented out. This confuses the reader greatly.
Blocks of commented-out code are confusing, misleading, and trouble. Someone will uncomment the code and reintroduce it at the wrong time. It will lead to bugs and faults.
If you don’t need code anymore, delete it. Deleted code has fewer bugs.
And if you really need to look back at prior versions, they are available in the git history.