Emacs takes many launch options. The one that you are looking for is
emacs -nw this will open emacs inside the terminal disregarding the DISPLAY environment variable even if it is set. The long form of this flag is
More information about emacs launch options can be found in the manual.