Undo has been available in the Alt Menu of GBoard for a while. Long press on an editable text field then select Undo in the popup alternative menu (sometimes you need to scroll over or tap the 3 dots to see the full menu choices)
The options that you see there are not dependent on your keyboard though. Change your keyboard to something else, and you still see the same options when long pressing a text field.