In general, do not commit commented code, unless you think that it should stay there as a documentation. Typically you would commit commented code when you want to tell the reader explicitly what some piece of code should not look like.

In these examples, if you're just unsure, then investigate more before committing. If you are sure then just remove the commented lines. And if you want to go back, to the previous state, after you've removed the lines, you can always see the previous version in git and copy the old state.