Alternatively, you didn't need to pack the whole directory. This would have also worked. I also added test2.txt to show the whole directory isn't unpacked.
$ cd $(mktemp -d) # New directory
$ touch test.txt test2.txt # Let's make a few files
$ tar -cf playground.tar *.txt # Pack everything
$ tar -tf playground.tar # What's in the archive?
test2.txt
test.txt # Look: No directory!
$ rm *.txt # Clear the source files to test unpacking
$ tar -xf playground.tar test.txt # Unpack one file (no directory name)
$ find .
.
./test.txt
./playground.tar # There it is!