I noticed my twenty twelve theme is including outdated versions of jquery and js so I want to replace the scripts with the newer versions, however the scripts are in the file included by wp_head() (which I think is in wp-includes) so adding the scripts to my header means jquery will be loaded twice, I see now way to remove the scripts from wp_head() without messing with wp-include and any changes I do will probably be lost if I update wordpress.
So how can I remove the scripts from wp_head() permanently?
That will deregister jquery. But why wouldn’t you want jQuery at all?
If you mean to simply use your own, you should do it in that function, like this:
This example loads Google’s jquery, but you could easily load one that you have in your own theme folder. You can read more about this process here: Function Reference/wp enqueue script « WordPress Codex
P.S. That would go in functions. And it is not a great idea to just stuff jquery library calls in your header, as it conflicts with plugins or other things that might be looking for jQuery to be present.
Simplest way to update jQuery is to use jQuery Updater plugin
If you just want to remove the wordpress version then add
wp_deregister_script('jquery');
to your
functions.php