Description

Short description of error
undo on bones in pose mode selects all channels in graph editor
tested on 2.76-2.79 on several machines

Exact steps for others to reproduce the error
1 Add a single bone or rigifay metarig or any other rig.
2 Go to the Pose mode.
3 Insert any keyframes on 1st frame
4 Go any other frame.
5 move\rotate\scale bone
6 Insert keyframes
7 Go to the graph editor and toggle on Show_only_selected option. Also toggle on - only_selected_curves_keyframes
8 Select any channel in the list. Let it will be - Loc X or whatever. So the only Loc X f-curve highlighted. Only Loc X keyframes are visible.
9 move any keyframe on f-curve.
10 Press ctrl+Z for Undo.
11 Now, after undo all existing channels become selected so you can see all the f-curves with all keyframes on them. Which is incorrect.

There is no such problem in object mode. If you repeat these steps on cube then after undoing in graph editor the only selected channel stay highlited with only that f-curve keyframes visible.

Is it part of the undo system or maybe something for @Alexander Gavrilov (angavrilov) to look at? It's pretty straight forward to reproduce just select a channel in the dopesheet, change a pose, undo, all channels get selected.

@Campbell Barton (campbellbarton) on today build (2.80 (sub 37), branch: blender2.8, commit date: 2018-12-16 23:25, hash: 9149e894210) it works as yours - it works fine in graph editor and in dope-sheet it selects all channels after undo. But it is not so important as in graph editor. So, as for me bug is closed)

This is not a matter of fixing a mistake in the code - Blender allows users to change the selection of the channels to make them out of sync with the pose bones ~ then refreshes these values on reload/undo/joining-area-regions.

A possible solution could be to leave the channel selection as-is when syncing on window refresh and file reload. So only explicit selection actions would touch channel selection. It will resolve the issue reported here but think it's likely to make the bones and channels get out of sync in other cases.

@Campbell Barton (campbellbarton) Ok, if I understand right then it depends on additional editors enabled (dopesheet, timeline) If you have graph editor only visible then undo works fine, if you have graph editor + timeline visible undo selects all channels.
But
If I create new file with one bone and animate it then it works as you said.
But I have another file with rigged character which I start to animate. There are graph editor and timeline visible at the same time and undo in graph editor does not selects all channels after undo. That is why I thought that "bug" is fixed. So I'am a little bit confused now about whats going on :) file is here -

But in this file some other problem is occured. While was testing that undo thing with channels seems that many undo in a row caused shading problem (But I'm not sure what exactly it cause, can't redo) All of a sudden in solid shading mode something like 'fade geometry' from overlays menu enables. But 'fade geometry' item disappears from overlays menu and there is no fast way to switch that silhouette off. Looks like switching overlays on\off for a few times solves that 'silhouette' problem, brings shading and fade geometry item back (But I'm not sure 100% again about the way I did it, it happened for a first time)