Just south of the Union lines before dawn on April 6 the Confederate commanders (Beauregard, A. S. Johnston, Bragg, Polk, Hardee and Breckinridge) held a council to determine if there should even be a battle. Beauregard was in favor of retreating back to Corinth as he was sure that the Union knew they were there (there had been many encounters between scouts of both armies) plus the inexperienced soldiers made too much noise during the march (men sang, shot at animals along the way, fired off their guns to make sure the powder was dry and bands played). Beauregard was sure that the Union was now completely entrenched. It was logical to assume the Union knew of their advance and was ready. As they debated gunshots were heard and Johnston proclaimed the battle already started.
Johnston could have easily sent orders withdrawing those engaged units and returning to Corinth. There are other examples in the war of battles barely starting before the attacker realizes the odds against them and withdraws, the Mine Creek Expedition in Virginia probably being the best known. A retreat to Corinth means that April 6 would have been known for just another small encounter between pickets of both armies and not the start of the battle of Shiloh.
Also it should be pointed out that while Johnston could have ordered his men to withdraw this would have actually been difficult to do. An interesting what-if to think about is if there had been a withdrawal what might Sherman and Grant have done. Would they have realized the opportunity in front of them? Would they have decided to wait an attack and made preparations for an assault once Buell's army arrived? I don't like to delve to deeply into what-ifs but sometimes they can be used to illuminate the options various commanders had. I don't know what Grant would have done. In 1863-4 he probably would have attacked but was his army the fine tool in 1862 that it was a year later? And did he realize this?
This is a very critical decision because a retreat means that there never would have been a battle of Shiloh.