Add partial /reset implementation

This code hasn't been tested at all, its probably bound to have some quirks in it! Only supports flags for now.