Don't comment out code and leave it in commits - just remove it. It's all in the history anyway. For imports in particular just use your IDE's organize imports option to clean them up.