How To Resetting Phone From Terminal

Often we forget our pattern locks in emergency situations where we need to make an emergency call or get to the mail and do not have enough time to get to a computer or try something else. How to reset phone without android ADT in the quickest possible way?
