public boolean refreshDBTypesFromOriginal() {
		synchronized (orphanIds) {
			return withTransaction("DataTypes Restored", () -> {
				boolean changed = false;
				clearUndoOnChange();
				Iterator<DataType> allDataTypes = getAllDataTypes();
				while (allDataTypes.hasNext()) {
					DataType dt = allDataTypes.next();
					if (dt == viewComposite || !(dt instanceof DatabaseObject)) {
						continue;
					}

					// subject all DB types to orphan check
					long myId = getID(dt);
					if (viewComposite != null) {
						orphanIds.add(myId);
					}

					Long originalId = dataTypeIDMap.getOriginalIDFromViewID(myId);
					if (originalId == null) {
						continue;
					}

					DataType originalDt = originalDTM.getDataType(originalId);
					if (originalDt == null) {
						changed = true;
						remove(dt);
						continue;
					}

					if (!originalDt.isEquivalent(dt)) {
						changed = true;
						try {
							originalDt = replaceDataType(dt, originalDt, true);
						}
						catch (DataTypeDependencyException e) {
							throw new AssertException(e); // should not occur
						}
					}

					CategoryPath path = dt.getCategoryPath();
					if (!originalDt.getCategoryPath().equals(path)) {
						Category newDtCat = createCategory(path);
						try {
							newDtCat.moveDataType(dt, null);
						}
						catch (DataTypeDependencyException e) {
							throw new AssertException(e); // should not occur
						}
					}

				}
				checkOrphansForRemoval(true);
				return changed;
			});
		}
	}
Refresh all datatypes which originate from the originalDTM.
This methods is intended for use following an undo/redo of the originalDTM only
and will purge the ID mappings for any datatypes which no longer exist or become
orphaned.
@return true if a dependency change is detected, else false
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/compositeeditor/CompositeViewerDataTypeManager.java