I have been asked many times what you should do if you forget your opening lines in one form of the question or another. The first thing you should do is think about your goals in the opening.
Let’s take some examples, even without exact moves. What if you have played White in the King’s Gambit Accepted and are down a pawn still by move 10 and you forget what to do? Traditionally your goals would be to occupy the center with pawns (since the central stronghold on e5 is gone, making way for an uncontested pawn on d4), get a lead in development and attack the opponent’s king. Are you able to achieve any of these goals? If so, how can you achieve them in the fastest possible manner? This will give you something concrete to do, and as long as you are aware of your opponent’s threat if they have one, you will be thinking about the right things.
How about almost the exact opposite example? What if you are playing Black in the Queen’s Gambit Accepted and you forgot your lines in the opening? What are you trying to do? In almost every single line, you want to try to trade off all of the pawns on the c and d-files and find good squares for the rest of your pieces. Thus, if you had not played …c5 and traded off the pawn for White’s d-pawn, you have a ready-made course of action. Once this is played, you will have to choose your piece setup in accordance with where the opponent’s pieces are to avoid direct threats and weak squares being occupied. The core of the setup to aim for is one in which your worst-placed piece is not bad at all and all of your pieces are on useful squares.
If there are extremely important variations that are do-or-die and may lose for either side if forgotten, you want to use every possible tool at your disposal so that you can either recall or find the only moves if you must. This means using every possible memory aid or hook available. What helps me is always knowing the opponent’s threat with every opening move I study, while also knowing my own goals. If you are dealing with the most critical line of your entire Grunfeld Black repertoire for example, slide through the variation 5 or 6 times with your arrow keys, focusing intently on the piece paths and threats of key pieces you have to notice. Just seeing the line and the final position of that line flash on your screen 5 or more times certainly helps give you visual pattern recognition that serves as an unconscious hook, even if you are unable to perfectly memorize a line over 20 moves.
Once you start doing this in all of your openings, not only will it become a habit, and lead to much greater understanding of your openings and the structures you play, but it will seem easy and automatic to do. With the tools we have available today, basic known information is not out of reach of any average chess player for free, so we need to take action and study actively, explaining to ourselves everything we understand and observe while we study our openings.