How to recompile the engine(not the project)

Technically UE4 is part of your project, UE was always like this as much as crazy it may sound UE4 is actually first version of UE that introduce project system. UE4 it self is technically empty project copy where you add up things with the project. So when you build your project the UE4 is also build and should apply changes, in fact some people complain about it. If you want to target UE4 specifically, right click UE4 project in solution and and build it, you can also try to rebuild. You can also generate UE4 project files with a bat inside engine folder, this should for 100% work, but if you got ready UE4 project this should not be needed.

Make sure you build Developer Editor build which is default one used in launcher build, any other create sperete set of modules and exe, so there possibility you building engine in different build then you actually running