This occurred to me playing some games where there is no live rewind feature. Basically what I'm looking for is an application which records the screen, and - when pressing a shortcut - rewinds what it has recorded in the last 10 seconds and then jumps back to normal.Is there an app which can do this? Or is this achievable in another way? 
Replay feature (repeat / rewind)
x11;recording;screencasting