Xcode 13: How to revert changes in side-by-side comparison?

Hello there!

In Xcode 13 I've lost an ability to revert changes in side-by-side comparison. There were buttons located in the center vertical line that separated two versions of the same file. Now these buttons are gone :(

Any suggestions where I can find them or how I can reset changes?

PS "reset" button resets commits selection

Answered by robnotyou in 690095022

On the far left, in the gutter, I get a vertical blue bar.
Clicking that shows the option "Discard Change"

Is that what you want?

Accepted Answer

On the far left, in the gutter, I get a vertical blue bar.
Clicking that shows the option "Discard Change"

Is that what you want?

Hmm, it looks like it only appears (vertical blue bar) if a commit on the right side is located earlier in history than a commit on the left side. If you try to swap them - changes are visible but vertical blue bar is not here anymore

Below the Add button in the toolbar is a set of three buttons. Click the middle button snd choose Side By Side Comparison to use side-by-side comparison.

To be able to revert changes you should work with 'Local Changes', not some point in history. This option is avaliable only on the left side of side-by-side mode.

To combine the excellent advice in this thread, all of which I had to follow to get this to work in Xcode 13:

Select Enable Code Review

Select side-by-side comparison from Adjust Editor Options

(the center button with horizontal lines in the image below)

Find the comparison arrow

at the bottom right of the content window,

Select the branch and commit hash you'd like to revert

on the right hand side of the code review selection arrows. (If your project has a large history, it may take some time for the commit hash list to populate.)

Choose Local Changes / Uncommitted Changes

on the left hand side of the code review selection arrows. This may be already selected, but you may need to reselect Local Changes if you've been mucking about with options for awhile.

Correctness check:

Your commit selection area should now look something like this:

Find the change and discard it

Now scroll to a change and click the blue bar in the gutter of the left-side editor. This will reveal the "Discard Change" action you've been dreaming of!

This was so useful feature, now it's SO broken. Apple please bring it back (revert if possible)

The feature is still available in the 'Commit' window when you're saving your entire project back into source control (menu 'Source Control', menu item 'Commit...'). The arrangement of controls along the bottom of the window is also the same as before. It seems this new, changed interface only appears in the side-by-side 'Code Review' window.

Not as useful if you just want to compare and perhaps revert changes in a single file. I second the motion that Apple make the old behavior available as an option to this new "improved" design.

Xcode 13: How to revert changes in side-by-side comparison?
 
 
Q