How can I restore default keyboard shortcuts?

It looks like the way keyboard shortcuts are implemented has slightly changed for Ubuntu 13.04

The shortcut settings are saved in the following locations (may be different for 12.10):

org.gnome.desktop.wm.keybindings
org.gnome.settings-daemon.plugins.media-keys
org.gnome.shell.keybindings
org.compiz.integrated

You can find these in the dconf-editor application, then using the "Set to Default" button to reset each desired entry. dconf-editor can be installed at the command line with sudo apt-get install dconf-tools.

Otherwise, you could also try resetting any one of the locations by using the following command in the terminal:

gsettings reset-recursively <insert location>

E.g.:

gsettings reset-recursively org.gnome.settings-daemon.plugins.media-keys`

They key bindings stored in the gconf database, but they aren't all in the same place unfortunately.

However, you can get a list of all the key bindings gconf keys by looking in the files located in /usr/share/gnome-control-center/keybindings/.

For example, /usr/share/gnome-control-center/keybindings/01-desktop-key.xml contains the list of keys for all the shortcuts Keyboard Shortcuts lists under Desktop.

<?xml version="1.0" encoding="UTF-8"?>
<KeyListEntries name="Desktop">
  <KeyListEntry name="/apps/gnome_settings_daemon/keybindings/help"/>
  <KeyListEntry name="/apps/gnome_settings_daemon/keybindings/calculator"/>
  <KeyListEntry name="/apps/gnome_settings_daemon/keybindings/email"/>
  <KeyListEntry name="/apps/gnome_settings_daemon/keybindings/www"/>
  <KeyListEntry name="/apps/gnome_settings_daemon/keybindings/power"/>
  <KeyListEntry name="/apps/gnome_settings_daemon/keybindings/screensaver"/>
  <KeyListEntry name="/apps/gnome_settings_daemon/keybindings/home"/>
  <KeyListEntry name="/apps/gnome_settings_daemon/keybindings/search"/>
</KeyListEntries>

Once you know the key name you can restore it to its default value.

For example, let's say you want to restore the shortcut to launch the calculator,

screenshot

Simply run:

gconftool -u "/apps/gnome_settings_daemon/keybindings/calculator"

screenshot


Building DoR's answer, this simple script, typed at the command line, will reset all shortcuts:

cd /usr/share/gnome-control-center/keybindings
for entry in $(grep KeyListEntry * |cut -d'/' -f2- |cut -d'"' -f1); do
    echo $entry
    gconftool -u "/$entry"
done