Index: /trunk/src/org/openstreetmap/josm/actions/InvertSelectionAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/InvertSelectionAction.java	(revision 16701)
+++ /trunk/src/org/openstreetmap/josm/actions/InvertSelectionAction.java	(revision 16701)
@@ -0,0 +1,41 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.actions;
+
+import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
+import static org.openstreetmap.josm.tools.I18n.tr;
+
+import java.awt.event.ActionEvent;
+
+import org.openstreetmap.josm.data.osm.OsmData;
+
+/**
+ * User action to invert the selection in the current dataset.
+ */
+public class InvertSelectionAction extends JosmAction {
+
+    /**
+     * Constructs a new {@code SelectAllAction}.
+     */
+    public InvertSelectionAction() {
+        super(tr("Invert Selection"), null, tr("Invert Selection"), null, true);
+        setHelpId(ht("/Action/InvertSelection"));
+    }
+
+    @Override
+    public void actionPerformed(ActionEvent e) {
+        if (!isEnabled())
+            return;
+        OsmData<?, ?, ?, ?> ds = getLayerManager().getActiveData();
+        ds.setSelected(ds.getPrimitives(t -> !t.isSelected()));
+    }
+
+    @Override
+    protected boolean listenToSelectionChange() {
+        return false;
+    }
+
+    @Override
+    protected void updateEnabledState() {
+        setEnabled(getLayerManager().getActiveData() != null);
+    }
+}
Index: /trunk/src/org/openstreetmap/josm/gui/MainMenu.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/MainMenu.java	(revision 16700)
+++ /trunk/src/org/openstreetmap/josm/gui/MainMenu.java	(revision 16701)
@@ -64,4 +64,5 @@
 import org.openstreetmap.josm.actions.InfoAction;
 import org.openstreetmap.josm.actions.InfoWebAction;
+import org.openstreetmap.josm.actions.InvertSelectionAction;
 import org.openstreetmap.josm.actions.JoinAreasAction;
 import org.openstreetmap.josm.actions.JoinNodeWayAction;
@@ -306,4 +307,6 @@
     /** Selection / Unselect All */
     public final UnselectAllAction unselectAll = new UnselectAllAction();
+    /** Selection / Invert Selection */
+    public final InvertSelectionAction invertSelection = new InvertSelectionAction();
     /** Selection / Non-branching way sequences */
     public final SelectNonBranchingWaySequencesAction nonBranchingWaySequences = new SelectNonBranchingWaySequencesAction();
@@ -845,4 +848,5 @@
         add(selectionMenu, selectAll);
         add(selectionMenu, unselectAll);
+        add(selectionMenu, invertSelection, true);
         add(selectionMenu, nonBranchingWaySequences);
 
