def cancel_moving(self):
        """Return selected obj(s) to initial position."""
        ### return objs to initial positions

        for obj in self.selected_objs:

            relative_midtop = obj.data["midtop"]

            absolute_midtop = tuple(relative_midtop + self.scrolling_amount)

            try:
                obj.rectsman.midtop = absolute_midtop
            except AttributeError:
                obj.rect.midtop = absolute_midtop

            if hasattr(obj, 'anchor_viewer_objects'):
                obj.anchor_viewer_objects()

        ### admin task: restore controls/behaviours

        ## controls

        self.unconstrain_axes()
        self.translation_factor = 1

        ## set window manager state
        APP_REFS.wm.set_state("loaded_file")

        ### if the moving_from_duplication flag is on,
        ### it means the objects where duplicate objects
        ### that were being moved; when the user cancels
        ### moving them in this specific case we assume
        ### the user wants to cancel the duplication, so
        ### the duplicate objects (the selected ones) are
        ### removed and the flag is set to False

        if self.moving_from_duplication:

            ## remove selected objects without changing
            ## the saved/unsaved state

            with saved_or_unsaved_state_kept():
                self.remove_selected()

            ## set flag off
            self.moving_from_duplication = False

        ### restart the loop
        raise ContinueLoopException
Return selected obj(s) to initial position.
nodezator/editing/reposition.py