Using sed I know how to delete certain line numbers like
sed -i.bak -e '6d;8d;15d;' file
How can I achieve the reverse of it. I want to keep those lines and delete the rest. I want to do this in place, as I have huge files and I'd use this as part of a larger script. I'm still keeping a backup as I don't want to mess up my original dataset.