"Generic Surface" can not assign arbitrary commands, "Key binding" requires the "Shift". Everything is as you have already found yourself. But there are other options.
1. Remove "Generic Surface" and put "ACT MIDI Controller" on its place, set its input to your pedal.
2. Open its interface (from the Utilities/Control module), click on lower cell under "B4" (by default you see "ACT Enable" there and "Off" under it, you should click on the cell with "Off"). "MIDI learn..." should appear.
3. Press the button on your controller, "MIDI Learn..." should disappear and everything reverted into "normal" mode (if "MIDI Learn..." is still there, check MIDI routing / "Input" in the Control Surface Sonar Preferences).
4. Switch to the "Options" tab. In the "Buttons" section select "B4" and change "ACT Enable" to "Edit | Undo" (the list is long, it is toward the beginning).
You button should do "Undo" now. I decide to use "B4" because B1-B3 are preassigned to useful operations, may be you want them for other buttons.
But there is yet another option... (my usual "advertisement" section...). With already described approach you can assign one action on one button. You can not configure context depended actions (f.e. do something else when recording or in playback) and you can not use "long press"/"double click". With AZ Controller that is possible.