[SalesForce] Command button display control

I have two command buttons (say A , B). I want when A is clicked then only B would be shown. When B clicked then it would be hidden again. Is this achievable ? Please find my page below.

Page snippet:

 <apex:panelGrid columns="3" >
        <apex:inputFile value="{!csvFileBody}"  />

        <apex:actionRegion >  
             <apex:commandButton value="Check updates" action="{!readcsvFile}" />  
        </apex:actionRegion>
        <apex:pagemessages id="errmsg"/>
        <apex:commandButton value="Reload file" action="{!reset}" onclick="window.location.reload();" rendered="{!sObjectList.size!=0}" />                

 </apex:panelGrid>

Best Answer

Update Vf as below

<apex:commandButton value="Check updates" action="{!readcsvFile}" />
<apex:commandButton value="Reload file" action="{!reset}" onclick="window.location.reload();" rendered="{!AND(sObjectList.size!=0,showReload)}" /> 

Take a boolean in your controller as below

public class mycontroller{
    public boolen showReload{get;set;}

    public mycontroller(){
         showReload=false;
    }
     public pagereference readcsvFile(){
        showReload=true;
        return null;
     }         
}