func Checkout(ref string, basePath ...string) error {
	oid, fullref := GetOid(ref)
	if strings.Contains(fullref, storage.BRANCH_DIR) {
		storage.SetHead(fullref)
	} else {
		log.Println("Detached HEAD mode")
		storage.SetHead(oid)
	}
	tree, _, _, err := GetCommit(oid)
	if err != nil {
		return err
	}
	return ReadTree(tree, basePath...)
}
/*
Checkout  moves HEAD to a commit oid and restore its state (e.g files and folders)
*/
Checkout  moves HEAD to a commit oid and restore its state
/ * Checkout moves HEAD to a commit oid and restore its state ( e . g files and folders ) * /
func Checkout(ref string, basePath ...string) error {
	oid, fullref := GetOid(ref)
	if strings.Contains(fullref, storage.BRANCH_DIR) {
		storage.SetHead(fullref)
	} else {
		log.Println("Detached HEAD mode")
		storage.SetHead(oid)
	}
	tree, _, _, err := GetCommit(oid)
	if err != nil {
		return err
	}
	return ReadTree(tree, basePath...)
}
func Checkout ( ref string , basePath ... string ) error { oid , fullref := GetOid ( ref ) if strings . Contains ( fullref , storage . BRANCH_DIR ) { storage . SetHead ( fullref ) } else { log . Println ( " " ) storage . SetHead ( oid ) } tree , _ , _ , err := GetCommit ( oid ) if err != nil { return err } return ReadTree ( tree , basePath ... ) }
Checkout  moves HEAD to a commit oid and restore its state
Checkout moves HEAD to a commit oid and restore its state