# Your first repository

Create a local repository, commit a file, and undo the commit.

## Before you begin

Use a disposable local repository for this exercise. You need Apple's Command Line Tools or Xcode, or [Full Git Integration](https://gitlode.com/docs/full-git-integration). You also need a global Git name and email configured in Settings > General. See [Configure Git and external tools](https://gitlode.com/docs/configure-tools). In Basic mode, Git reads that name and email only if GitLode can read your home folder. See [Folder access](https://gitlode.com/docs/folder-access). You do not need a remote repository or a diff tool.

## Create and commit a file

1. Open the toolbar's plus menu and choose New Repository.
2. Choose a new folder named `gitlode-practice` in a location you can find in Finder.
3. In a text editor, create a file named `hello.txt` inside that folder. Enter `My first commit.` and save it. In TextEdit, choose Format > Make Plain Text before saving.
4. Return to GitLode and select Working Changes, or press Command+1.
5. Select the checkbox beside `hello.txt`. A checked file is staged, which means its changes are included in the next commit.
6. Enter `Add hello file` in the commit message field, then click Commit.
7. Select the new commit in history. Check its message and changed-file list. Select `hello.txt` and press Space to preview the committed file.

## Undo the commit

1. Click the history list to move focus outside the message editor.
2. Choose Edit > Undo Commit. You can also open Activity with Command+0, select the commit operation, and click Undo.
3. Return to Working Changes. Check that `hello.txt` is still present and staged, and that the commit message has returned.

You can edit the file or message and commit again. For other operations and recovery limits, see [Undo an operation](https://gitlode.com/docs/undo-an-operation).
