TString cwd(gSystem->pwd()); // "save" the name of the "current working directory"
// ... do whatever you want ...
gSystem->cd(cwd.Data()); // "go back" to the old ("saved") subdirectory
Note that this is the same solution as shown here: [url]TSystemDirectory::GetListOfFile null pointer
See also: http://root.cern.ch/root/html/TSystem.html