The Poskim deal with an interesting case of Borer, involving selecting clothes from a dark room on Shabbat. If a person has, for example, many pairs of dark colored socks-brown, black, navy etc.-and wants to select a certain color, his desired pair is not easily discernible in the dark. He must pick a random pair and hold it up to determine its color. One might argue that if he picked out the wrong color, then his selection constitutes removing P’solet (waste) from the mixture and would be a violation of Borer.
Rabbi Shlomo Miller, in his Sefer, Shabbat Shel Shlomo (p. 177), presents a number of rationales why this does not constitute Borer. First, Borer is only when one makes a Tikun of a mixture by removing definitive bad from definitive good. In this case, it is not clear that it is P’solet at the time that he removes it. He is removing it to find out which it is.
Moreover, if he would discover that it was the wrong pair, he should immediately throw it back in the drawer, which would clearly indicate that he did not perform a Tikun on the mixture. Therefore, although some Poskim argue, it is permitted to remove each pair one by one to discern whether it is the desired one, if he returns the undesired pair immediately back to the drawer.
It is permitted to remove an item from a mixture to determine whether it is the desired item, if he returns it to the mixture immediately, in the event he discovers that it is not.