# Source: https://docs.replit.com/replit-workspace/workspace-features/file-history.md

> ## Documentation Index
> Fetch the complete documentation index at: https://docs.replit.com/llms.txt
> Use this file to discover all available pages before exploring further.

# File History

> To make sure you never lose any of your work, Replit auto-saves your code as you write. If you ever lose an edit to your code that you'd like to recover, rewind back in time with File History.

Get started by opening a text file in the Workspace and pressing the **History** button in the bottom-right corner.

<Frame>
  <img src="https://mintcdn.com/replit/AZ1L8RlIroSxuJDa/images/programming-ide/history-button.png?fit=max&auto=format&n=AZ1L8RlIroSxuJDa&q=85&s=af81288cec5195969d95713cf3904609" alt="opening history" data-og-width="377" width="377" data-og-height="292" height="292" data-path="images/programming-ide/history-button.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/replit/AZ1L8RlIroSxuJDa/images/programming-ide/history-button.png?w=280&fit=max&auto=format&n=AZ1L8RlIroSxuJDa&q=85&s=30e1252941041e90d5b1ee532bbdc1ef 280w, https://mintcdn.com/replit/AZ1L8RlIroSxuJDa/images/programming-ide/history-button.png?w=560&fit=max&auto=format&n=AZ1L8RlIroSxuJDa&q=85&s=74a737215915f8e3c90bce57728b664e 560w, https://mintcdn.com/replit/AZ1L8RlIroSxuJDa/images/programming-ide/history-button.png?w=840&fit=max&auto=format&n=AZ1L8RlIroSxuJDa&q=85&s=764dfca5d6e826c1655b7b33c8b177ca 840w, https://mintcdn.com/replit/AZ1L8RlIroSxuJDa/images/programming-ide/history-button.png?w=1100&fit=max&auto=format&n=AZ1L8RlIroSxuJDa&q=85&s=fb1ea972258001efa7fb4b63f9fda90e 1100w, https://mintcdn.com/replit/AZ1L8RlIroSxuJDa/images/programming-ide/history-button.png?w=1650&fit=max&auto=format&n=AZ1L8RlIroSxuJDa&q=85&s=2dc388f53da135197f7ee3e74183c81e 1650w, https://mintcdn.com/replit/AZ1L8RlIroSxuJDa/images/programming-ide/history-button.png?w=2500&fit=max&auto=format&n=AZ1L8RlIroSxuJDa&q=85&s=b21879b965450e004c3bd25588738594 2500w" />
</Frame>

## Viewing previous versions of a file

Once you've opened up File History, you can view previous versions of a file by using the scroll bar, the arrow buttons, or the **left** and **right** arrow keys.

<Frame>
  <img src="https://mintcdn.com/replit/-6g2hQCrMskerX65/images/animations/history-versioning.gif?s=0ea4ddbe452557870f88eff87b3960dd" alt="scroll bar demo" data-og-width="764" width="764" data-og-height="720" height="720" data-path="images/animations/history-versioning.gif" data-optimize="true" data-opv="3" />
</Frame>

## Comparing previous versions to the current file

Press the Compare Latest toggle in the bottom left hand of the File History pane to see in-line comparisons of your file at that point in time and the latest version.

<Frame>
  <img src="https://mintcdn.com/replit/-6g2hQCrMskerX65/images/animations/compare-history.gif?s=96b290dc3ded58a6eb2e0bbd70c72285" alt="compare latest image" data-og-width="772" width="772" data-og-height="720" height="720" data-path="images/animations/compare-history.gif" data-optimize="true" data-opv="3" />
</Frame>

## Restoring a previous version of a file

If you want to restore a file to a previous version, just press the `Restore` button, which will restore. Don't worry, you won't erase any history. When you restore to a previous version, it is added as a new version to the file's history.

<Frame>
  <img src="https://mintcdn.com/replit/-6g2hQCrMskerX65/images/animations/restore-history.webp?fit=max&auto=format&n=-6g2hQCrMskerX65&q=85&s=bb106086874ec8cd69cf7f5c2f1b6efb" alt="restore history image" data-og-width="720" width="720" data-og-height="495" height="495" data-path="images/animations/restore-history.webp" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/replit/-6g2hQCrMskerX65/images/animations/restore-history.webp?w=280&fit=max&auto=format&n=-6g2hQCrMskerX65&q=85&s=3a25dcac4739575dea1f645f619ae427 280w, https://mintcdn.com/replit/-6g2hQCrMskerX65/images/animations/restore-history.webp?w=560&fit=max&auto=format&n=-6g2hQCrMskerX65&q=85&s=354c06b296c7cc4d478a7e202e2f4acb 560w, https://mintcdn.com/replit/-6g2hQCrMskerX65/images/animations/restore-history.webp?w=840&fit=max&auto=format&n=-6g2hQCrMskerX65&q=85&s=42855ababa9d2d1e43da795adb48416f 840w, https://mintcdn.com/replit/-6g2hQCrMskerX65/images/animations/restore-history.webp?w=1100&fit=max&auto=format&n=-6g2hQCrMskerX65&q=85&s=80d06d91dc12dc0d56627b81f9d83674 1100w, https://mintcdn.com/replit/-6g2hQCrMskerX65/images/animations/restore-history.webp?w=1650&fit=max&auto=format&n=-6g2hQCrMskerX65&q=85&s=cb3f97084b2dce5fb690392db878bc97 1650w, https://mintcdn.com/replit/-6g2hQCrMskerX65/images/animations/restore-history.webp?w=2500&fit=max&auto=format&n=-6g2hQCrMskerX65&q=85&s=b8814199859cab4d96eeafec498ce7f2 2500w" />
</Frame>

## Viewing File History playback

You can use the playback feature of File History to watch your file change over time like a movie. This can be useful for creating videos of your programming sessions.

<Frame>
  <img src="https://mintcdn.com/replit/-6g2hQCrMskerX65/images/animations/history-replay.webp?fit=max&auto=format&n=-6g2hQCrMskerX65&q=85&s=35f40811914251d499fe2d64015a2227" alt="replay history video" data-og-width="720" width="720" data-og-height="528" height="528" data-path="images/animations/history-replay.webp" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/replit/-6g2hQCrMskerX65/images/animations/history-replay.webp?w=280&fit=max&auto=format&n=-6g2hQCrMskerX65&q=85&s=bf8a8b45d8ad99252148b436c65dd80a 280w, https://mintcdn.com/replit/-6g2hQCrMskerX65/images/animations/history-replay.webp?w=560&fit=max&auto=format&n=-6g2hQCrMskerX65&q=85&s=d01dcd777617ffc47b181d5b707642c4 560w, https://mintcdn.com/replit/-6g2hQCrMskerX65/images/animations/history-replay.webp?w=840&fit=max&auto=format&n=-6g2hQCrMskerX65&q=85&s=f517c44b548ac06dc5707d4ac7dce9e7 840w, https://mintcdn.com/replit/-6g2hQCrMskerX65/images/animations/history-replay.webp?w=1100&fit=max&auto=format&n=-6g2hQCrMskerX65&q=85&s=b7e84a6f714a1163d5c113e04651e4ea 1100w, https://mintcdn.com/replit/-6g2hQCrMskerX65/images/animations/history-replay.webp?w=1650&fit=max&auto=format&n=-6g2hQCrMskerX65&q=85&s=8d95dd27f60fe9469f97493fc64ec040 1650w, https://mintcdn.com/replit/-6g2hQCrMskerX65/images/animations/history-replay.webp?w=2500&fit=max&auto=format&n=-6g2hQCrMskerX65&q=85&s=9b5007f197e9e22abc6b0b7a10720e4e 2500w" />
</Frame>