If you are a LPR and find yourself in removal proceedings, you may be eligible for a form of relief called cancellation of removal for lawful permanent residents. It allows you to retain your green card. In order to succeed, however, you must prove that you:
have been a lawful permanent resident of the U.S. for at least five years at the time that the application is filed
continually resided in the U.S.for at least seven years after being admitted in any status and before the “stop-time rule” is triggered