DEV Community


Discussion on: I'm a Git Master, Ask Me Anything

gonedark profile image
Jason McCreary Ask Me Anything • Edited

Commented code is dead code - REMOVE IT! Let Git do its job.

But yes, I recommend doing it as a separate commit with a clear commit message on what code was deleted so you have the best chance of finding it again.

However, from my experience, it's rare you'll actually look for code this way. Most people just go back to a known point in history to see old code instead of trying to pinpoint the exact commit.