First App.
Your learning space A little progress, every day
CHAPTER 07Lesson 19 of 20

Preview, publish and undo an update

Your local folder is where you edit. GitHub carries saved changes, and Cloudflare turns them into the live version.

In GitHub Desktop and Cloudflare10 min read & do
By the end of this lesson

Use a preview for a change, publish it deliberately and know how to undo it.

Let’s do this

  1. 1
    In GitHub Desktop

    Get the latest files before editing

    Open the same project in GitHub Desktop and click Fetch origin. If it offers Pull origin and you have no conflicting local work, bring in the saved changes. If you already have edits, ask the AI to help preserve them first. Reopen the folder in your helper and restart the preview.

  2. 2
    In GitHub Desktop

    Create a branch for a larger change

    A branch is a separate line of work. In GitHub Desktop use Current Branch, then New Branch, and name it improve-homepage. Have the AI make and test the change there. Commit it, then Publish branch or Push origin. Main stays as it was.

  3. 3
    In Cloudflare

    Open the Cloudflare preview

    Pages normally builds other branches into preview deployments. Find yours under the Pages project’s Deployments and open its preview link. Test on your phone. Preview links are public by default, even when the GitHub repository is private. Use sample data; protected previews require a separate setup.

    Cloudflare Pages: preview deployments (opens a new tab)
  4. 4
    In GitHub

    Merge when you want it live

    Use GitHub Desktop’s Create Pull Request action, or Compare & pull request on GitHub. Review the change and checks, then merge into main. A pull request is a review page for joining the change to main. Cloudflare builds main again. Check that the latest successful deployment is the intended commit.

    Cloudflare Pages: connect GitHub (opens a new tab)
  5. 5
    In Cloudflare and GitHub Desktop

    Undo both the live change and its source if needed

    For an urgent problem, Cloudflare can roll back to an earlier successful production deployment. Then revert the faulty commit in GitHub Desktop and push that correction to main, resolving any conflicts carefully. Rolling back hosting alone leaves the faulty source ready to return on a future build. A code rollback does not undo database changes.

    Cloudflare Pages: rollbacks (opens a new tab)

A message for your AI helper

I want to update my first website with [one change]. Check the current repository and any unsaved work. Help me use a branch, test locally, commit, push and check its Cloudflare preview. Explain when merging into main will publish it. Use sample data because preview URLs may be public. Give me a simple recovery plan for the live deployment and the source. Do not discard existing work.

What you should see

You can trace an update from your Mac through a preview to the live site, and know how to correct a bad release.

If you get stuck

Go at your own pace. There is no test to pass.

Checked 7 September 2026. Screens can change; the official guides below have the latest steps.

Cloudflare Pages: preview deploymentsCloudflare Pages: connect GitHubCloudflare Pages: rollbacksGitHub Desktop: revert a commit