
How to revert using Git on Simulink UI?
23 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
MathWorks Support Team
am 25 Jul. 2018
Bearbeitet: MathWorks Support Team
am 20 Dez. 2023
I want to revert the entire Simulink Project to a specific revision. How can I do this using Git source control on the Simulink Project UI?
Akzeptierte Antwort
MathWorks Support Team
am 21 Nov. 2023
Bearbeitet: MathWorks Support Team
am 20 Dez. 2023
It is not currently possible to create an inverse commit from project history directly from the Simulink Project UI. As a workaround, do the following:
1) Open the git branch manager, find the ID of the commit that you want to revert to, and note that down.
2) Close the project.
3) In MATLAB Command Window, reset the HEAD to the second revision:
!git reset --hard [commitID]
At this point, the HEAD and the "master branch should be at the same location.
4) Create and add a new script into the project.
5) Open Simulink Project and click Commit.
At the end of this, you should be able to see in the Simulink Project > Branches window similar to the attached file:

In general, MATLAB path will prevent any source control tool from deleting folders that are on the path. MATLAB's git integration can work around this issue, but command line git might cause problems. If reverting the project will not involve folder deletion, then the project can be kept open (neglecting step 2 from above).
1 Kommentar
Felix Mireisz
am 15 Mai 2023
Hey everyone,
is there in 2023 a solution in MATLAB implemented which makes this possible with the Simulink Project UI?
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Project Management finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!