I read one fic james and lily are dating.. peter already in voldemorts circle..james get captured and has a memory loss because of several cruciatus curses.. at the same time rookwwod(i guess) takes his place at hogwarts with the help of potion??
Found it! The events you described seem to start in chapter 35 (possibly 34):
Title: White Flags
Genre(s): Drama, Romance
Word Count: 113,374
Summary: Who’d have thought that the man who tore them apart was the one who brought them together? Head Girl Lily Evans is determined to keep her distance from the Marauders but that’s easier said than done when James is Head Boy and in love with her. It also doesn’t help that she becomes rather attached to Sirius during an eventful Defence Against the Dark Arts lesson…