The graphic part of your model should also be stored somewhere, and the Modelica place uses so-called annotations. Each model, example model, and also each connection have such annotations. The graphics do not affect the pyhsical behavior, but they are still important for the convenience of end users.
Now, if you are editing any icon or connection (or anything else) from the graphical user interface, this change will be reflected in the code. And as soon as you press the save button, the file will be written to disk, and git will notice that the code has changed. Some of these changes can be targeted (some people invest a lot of time in beautiful applications), while other changes may not be important. There is absolutely no way how a version control system can decide what you think is relevant; this decision is up to you. You can always decide NOT to save your changes (in Dymola, select the Save None button).
In addition to the changes you are responsible for, your tool (e.g. Dymola) may try to be smart and do some automatic formatting. There are users who find Dymolas behavior too intrusive (for example, line breaks, inserting spaces, adding irrelevant annotations, moving comments around). Unfortunately, little can be done here, except, of course, to stop using Dymola as an editor (and instead use it only as a modeling tool), or you can use a cleaning tool such as ttws (trim-trailing-white-space ), As far as I know, Dymola does not navigate your icons, so the example you showed was not introduced by Dymola.
Now, the second part of your question. If for some reason you clicked the save button, git (and any other good version control system) allows you to revert your changes or part of your changes before committing (or after committing, but then the situation becomes more complicated), In addition, you don’t you need to push all your commits to the central repository. The exact workflow will depend on which git client you are using and whether you are using a graphical user interface or command line. Which one are you using?
Below is a screenshot of the GitExtensions commit dialog (this image is the main reason for writing the answer instead of the comment):

- In the upper left you see all the files in which git noticed a change, here you can return entire files.
- In the bottom left you see an intermediate area. Only files in the staging area will be part of your commit.
- At the top right, you see diff and a context menu that allows you to reset single lines of code.
- In the lower right corner, enter the text of the commit message.
There are many tutorials and books on how to use git, you will probably want to read them, as well as a guide for the git client of your choice. Or you just don’t press the save button when you don’t want to save anything.
source share