Restore submodule to branch

The project I’m working on has a main repository with a single submodule. In my branch, I have managed to delete the submodule, so that when the branch is pushed to GitHub, the submodule no longer appears. (Note: the way the main repository is structured is that there is a link from the main repo to the repo containing the submodule, and that’s what I want in the end.)
What is the simplest way to fix this problem? (I hope this is enough information and that I haven’t omitted anything crucial.)

It’s not really clear what your end goal is here, but if you want to have the submodule back you could either

  1. reset the branch to a state before you removed it, or
  2. revert the commit that removed it, or
  3. recreate the submodule like a completely new one.

If you’re on a development branch 1 is probably the cleanest one (as in, won’t leave a trace in the history after merging), though if you made commits after you’ll have to rebase to do it.