If this is a friendly game, there is no actual method to deal with it besides what you come up with. My initial gut instinct would say "shuffle up all the cards you weren't allowed to see".
If this is a tournament though, here's what the Infraction Procedure Guide has to say:
EDIT: Summary: Call a judge. The judge will issue a warning, then find out from the players if any cards were supposed to be known (due to scry or whatnot). Then they'll reshuffle all the cards whose positions are not known.
Quote:
2.2. Game Play Error — Looking at Extra Cards
Definition
A player looks at a card they were not entitled to see. Players are considered to have looked at a card when they have been able to observe the face of a hidden card, or when a card is moved any significant amount from a deck, but before it touches the other cards in their hand. This includes errors of dexterity or catching a play error before the card is placed into his or her hand. Once a card has been placed into his or her hand or if a player takes a game action after removing the card from the library, the offense is no longer Looking at Extra Cards.
A player is not considered to have looked at extra cards when he or she places a card face down on the table (without looking at the card) in an effort to count out cards he or she will draw.
This penalty is applied only once if one or more cards are seen in the same action or sequence of actions.
Examples
A. A player accidentally reveals (drops, flips over) a card while shuffling her opponent’s deck.
B. A player flips over an extra card while drawing from his deck.
C. A player sees the bottom card of her deck when presenting it to her opponent for cutting/shuffling.
D. A player activates a Sensei’s Divining Top that is no longer on the battlefield, and sees 3 cards before the
mistake is noticed.
Remedy
Penalty: Warning
Additional Remedy
Shuffle the randomized portion of the deck (which may include the cards that were seen, if they were part of the random portion of the library). This requires first determining whether any portion of the deck is non-random, such as cards that have been manipulated on the top or bottom of the library, and separating those. Once the deck has been shuffled, any manipulated cards are returned to their correct locations.
Care must be taken before shuffling to make sure that there are no “legally known” cards in the library. Check with both players to verify this, and check the graveyard, exile, and battlefield for deck manipulation cards, such as Brainstorm and cards with the scry mechanic.
Philosophy
A player can accidentally look at extra cards easily. Drawing extra cards is a separate, more severe Game Play Error.
Players should not be using this penalty to get a “free shuffle” or to attempt to shuffle away cards they don’t want to draw; doing so may be Unsporting Conduct — Cheating. Players also are not allowed to use this penalty as a stalling mechanism. The deck is already randomized, so shuffling in the revealed cards should not involve excessive effort.