Fix: wrong reset --hard + new function generate_files