code: public void undo(@NonNull final View view) {
          if (mSwipeTouchListener != null) {
              if (mSwipeTouchListener instanceof SwipeUndoTouchListener) {
                  ((SwipeUndoTouchListener) mSwipeTouchListener).undo(view);
              } else {
                  throw new IllegalStateException("Enabled swipe functionality does not support undo");
              }
          }
      }
docs: Performs the undo animation and restores the original state for given {@link android.view.View}.
  <p/>
  This method does nothing if no swipe functionality is enabled.
  It will however throw an exception if an incompatible swipe functionality is enabled.
  
  @param view the parent {@code View} which contains both primary and undo {@code View}s.
  
  @throws java.lang.IllegalStateException if the {@link com.nhaarman.listviewanimations.itemmanipulation.swipedismiss.SwipeTouchListener}
  that is enabled doe snot extend {@link com.nhaarman.listviewanimations.itemmanipulation.swipedismiss.undo.SwipeUndoTouchListener}.