How to delete Energy configuration and start again?

Here is the associated error message from the log:

Logger: homeassistant.components.websocket_api.http.connection
Source: components/energy/validate.py:300
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 12:22:22 (2 occurrences)
Last logged: 13:13:47

[140336684923248] Error handling message: Unknown error
[140336484362752] Error handling message: Unknown error
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 26, in _handle_async_response
    await func(hass, connection, msg)
  File "/usr/src/homeassistant/homeassistant/components/energy/websocket_api.py", line 167, in ws_validate
    connection.send_result(msg["id"], (await async_validate(hass)).as_dict())
  File "/usr/src/homeassistant/homeassistant/components/energy/validate.py", line 300, in async_validate
    hass.data[DOMAIN]["cost_sensors"][flow["stat_energy_from"]],
KeyError: ''