Videos
How to remove unwanted objects from a photo?
How to remove blemish or wrinkles?
How to remove people from a photo?
There is a better way to phrase it, but it's also OK. That is to say, in contexts other than a commit message, you would probably want to rewrite the sentence, but for an internal note, it's fine.
The main issue with the sentence is that you're using commented out as a compound adjective and so you should probably hyphenate the phrase: "Remove the commented-out code." Hyphenation would also improve your last example sentence: "Help the left-behind people" is better, but "Help the people who were left behind" is better still.
If I were trying to express the idea of your commit message in a more formal context, a context where prose style is important, or really any context without a strict and low character limit, I would write, "Remove the code which was commented out."
Commit summaries (the single first line of a commit, and often the entire message) are a defined genre of technical speech because they have a specific role of identifying changes in a big list of changes and are limited to a certain number of characters. In particular, they are usually written in imperative ("Remove" vs. "Removed") and in headlinese for the same goal of fitting information into a limited space. Thus these are all considered helpful commit summaries:
- Remove commented-out code
- Refactor foo service
- Add new SMS implementation for Bar Mobile
As noted elsewhere, "commented-out" should be hyphenated as it's a phrasal adjective; otherwise, the way you're phrasing it is stylistically preferred for this specific context.