How to remove development tool on debian server

I am a newbie and I have read this post

https://security.stackexchange.com/questions/12113/installing-development-tools-on-production-server-security-risk 

I have installed build-dep and other development tools on debian server. How do I remove them? Is it save after I remove them?