Jason,
This is a script I use for deploying my sites:

#!/bin/bash

# deploy.sh for example.com
# Deploys current HEAD or a selected tag to production from git repository

TAG="HEAD"
STAMP=`date +%Y.%m.%d_%H%M%S`
BASEDIR="/home/www-data/example.com"
REPO="/home/scm/example.git"


echo "Deploying $TAG to production in $STAMP."

cd $BASEDIR/releases/ && \
git archive --format=tar --remote=$REPO $TAG | \
(tar xf - public/) && \
mv public ${STAMP} && \
rm ${BASEDIR}/current && \
cp ${BASEDIR}/shared/wp-config.php
${BASEDIR}/releases/${STAMP}/wp-config.php && \
ln -s ${BASEDIR}/shared/wp-content/blogs.dir \
    ${BASEDIR}/releases/${STAMP}/wp-content/blogs.dir && \
ln -s ${BASEDIR}/shared/wp-content/uploads \
    ${BASEDIR}/releases/${STAMP}/wp-content/uploads && \
ln -s ${BASEDIR}/releases/${STAMP} ${BASEDIR}/current

echo "Cleaning up older releases"
cd $BASEDIR/releases && ls -1tr | head -n -3 | xargs rm -fr

echo "Finished.";

So I have my DocumentRoot configured to point to "current". If I want
to roll back, I just delete that current link and link to my previous
release.

This example happens to be for WordPress. Hopefully you get the idea.
The 'shared' directory is for content that is shared between releases,
and not tracked in version control.

-Erik

On Tue, May 24, 2011 at 2:38 PM, Jason Hsu <jhsu802701 at jasonhsu.com> wrote:
> I'm using Git and GitHub for developing Swift Linux.
>
> Is there a way to implement version control for a web site so that you can revert to earlier versions of files if something goes wrong when you make a change?
>
> --
> Jason Hsu <jhsu802701 at jasonhsu.com>
> _______________________________________________
> TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
> tclug-list at mn-linux.org
> http://mailman.mn-linux.org/mailman/listinfo/tclug-list
>



-- 
Erik K. Mitchell -- Web Developer
erik.mitchell at gmail.com
erik at ekmitchell.com
http://ekmitchell.com/