Difference between text filter types? When creating text filter, there are several "type" options (see here). What is the difference between these two? 

FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE: Irreversible transformation filters.
FilterInterface::TYPE_TRANSFORM_REVERSIBLE: Reversible transformation filters.


Are there some examples when to use them? For example, when I add a class to a HTML element without any class or specific attribute, is that reversible or irreversible?
Per the Filter API docs:


  
  Every filter plugin must specify a filter type in its annotation. Filter types were added specifically to support in-place editing. There are four filter types:
  
  
  FilterInterface::TYPE_MARKUP_LANGUAGE — Non-HTML markup language filters that generate HTML. The filter converts something that's not HTML to HTML in a way that is not compatible with WYSIWYG editing.
  FilterInterface::TYPE_HTML_RESTRICTOR — HTML tag and attribute restricting filters to prevent XSS attacks. The filter restricts the HTML allowed, for example, to protect against XSS.
  FilterInterface::TYPE_TRANSFORM_REVERSIBLE — Reversible transformation filters. The filter performs a transform for which a WYSIWYG plugin exists to perform the same transformation (and its reverse) client-side. For example, &lt;img data-caption="Druplicon"&gt; may be (reversibly!) transformed to &lt;figure&gt;&lt;img&gt;&lt;figcaption&gt;Druplicon&lt;/figcaption&gt;&lt;/figure&gt;.
  FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE — Irreversible transformation filters. The filter performs a transform for which a WYSIWYG plugin does not exist to perform the transformation client-side (especially, the reverse of it); instead, the WYSIWYG editor displays the unfiltered text. For example, Token Filter.
  
  


The type examples given are pretty descriptive of when to use them. 

If you CAN take the filtered output and put it back into its original form via a WYSIWYG plugin (e.g. structured markup like XML -> JSON -> XML), use FilterInterface::TYPE_TRANSFORM_REVERSIBLE because the filter output can be reversed. 

If you CANNOT take the filtered output and put it back into its original form via a WYSIWYG plugin(e.g. a token filter that prints the node title), use FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE because the filter output cannot be reversed.