Edward wrote about "Undo". The usual way to do this is with "CTRL-Z", once for every action (i.e., keystroke"). So if you typed 20 characters after the delete, you might have to hit CTRL-Z 20 times (sometimes several keystrokes may be undone at once, so it may not be exactly 20). It works - I've done the same thing.
The suggestion of getting it back from GitHub probably doesn't apply to you. If you had earlier versions of your work under version control on Github, then you could get back an earlier version. But you probably haven't been using that.