Whether you use Gmail online or on a mobile app, you can undo any message using the Undo Send setting, which is turned off by default. The setting automatically delays outgoing messages for up to 30 seconds after you press Send.
How to 'Undo' an Email in Gmail
To have Gmail delay the delivery of sent messages for a few seconds so you can retrieve them:
Open Gmail and select the Settings icon (gear) in the upper-right corner of the window. Choose Settings from the menu.
Select Show all settings.