Un-do ref changes for js scripts