How to reproduce:
1. Open the user's attached project
2. Select Assets/TEST/Bugged.asmdef
3. Add an Assembly Definition Reference
4. Deselect "Bugged.asmdef"
5. Hold CTRL+Z
6. Repeat step 2
Expected results: Changes to "Bugged.asmdef" are undone
Actual results: Changes to "Bugged.asmdef" are not undone
Reproducible with: 2021.3.34f1, 2022.3.17f1, 2023.2.5f1, 2023.3.0b3
Reproducible on: Windows 10 22H2
Not reproducible on: No other environment tested