When you delete a procedure or procedure body from a program, it is not removed from the database immediately and if it is used elsewhere in this program or in another program, it will not be removed from the database at all.
If you delete a procedure by accident, it is not necessarily lost. Up to 32 deleted procedures may remain available and may be re-inserted. However, this is not guaranteed and the deleted procedures will be lost when you exit the Program Flow Diagram.
You will sometimes want to delete a procedure from one place in the procedure tree and move it to another part. The safe way to do this is explained in Moving Procedures.
You can protecting procedures from accidental deletion from the database by adding them to a library program, or by tying them to a program. If a procedure is tied it will not be deleted even if it is (temporarily) deleted from the program it is tied to.