Skip to content

Commit a18c698

Browse files
authored
Merge pull request #43905 from github/repo-sync
Repo sync
2 parents 8102cd9 + 5e795b5 commit a18c698

File tree

23 files changed

+574
-124
lines changed

23 files changed

+574
-124
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Docs changelog
22

3+
**21 April 2026**
4+
5+
We recently published two new guides for organizations adopting Copilot cloud agent.
6+
7+
* Pre-enablement: [Building guardrails for GitHub Copilot cloud agent](https://docs.github.com/en/enterprise-cloud@latest/copilot/tutorials/cloud-agent/build-guardrails) helps you expand built-in protections to create a secure environment for agents to operate in.
8+
* Post-enablement: [Giving GitHub Copilot cloud agent access to resources in your organization](https://docs.github.com/en/enterprise-cloud@latest/copilot/tutorials/cloud-agent/give-access-to-resources) helps you get more out of Copilot by giving it access to MCP servers and internal packages, while promoting secure, consistent practices.
9+
10+
<hr>
11+
312
**15 April 2026**
413

514
LSP servers greatly improve Copilot CLI's ability to work with your code. For example, when Copilot renames a symbol throughout a project it can do this more quickly and reliably if it has access to an LSP server for the language the code is written in.
Binary file not shown.
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
---
2+
title: Canceling a {% data variables.copilot.copilot_cli %} operation and rolling back changes
3+
shortTitle: Cancel and roll back
4+
intro: 'Find out about the different ways to cancel an active {% data variables.product.prodname_copilot_short %} operation, and how to roll back changes made during a session if the result isn''t what you expected.'
5+
versions:
6+
feature: copilot
7+
contentType: concepts
8+
docsTeamMetrics:
9+
- copilot-cli
10+
category:
11+
- Learn about Copilot # Copilot discovery page
12+
- Learn about Copilot CLI # Copilot CLI bespoke page
13+
---
14+
15+
## Introduction
16+
17+
When you work in an interactive {% data variables.copilot.copilot_cli_short %} session, you can press <kbd>Esc</kbd> or <kbd>Ctrl</kbd>+<kbd>C</kbd> to control what {% data variables.product.prodname_copilot_short %} is doing. Both keypresses can cancel operations, but they work slightly differently:
18+
19+
* <kbd>Ctrl</kbd>+<kbd>C</kbd> immediately stops the current operation.
20+
* A single <kbd>Esc</kbd> keypress gives you more gradual control—letting you dismiss dialogs, clear queued prompts, or cancel an operation in stages.
21+
22+
If {% data variables.product.prodname_copilot_short %} has already made changes and you want to undo them, you can roll back your workspace to a previous point in the session. {% data variables.copilot.copilot_cli_short %} takes a snapshot of your workspace state each time you enter a prompt, and this allows you to rewind to an earlier state by pressing <kbd>Esc</kbd> twice when {% data variables.product.prodname_copilot_short %} is idle and the input area is empty.
23+
24+
## What pressing Esc does in different situations
25+
26+
Pressing <kbd>Esc</kbd> once performs different actions depending on the current state of the session:
27+
28+
| Current state | What pressing <kbd>Esc</kbd> does |
29+
| ------------- | ------------------------ |
30+
| {% data variables.product.prodname_copilot_short %} is active with no queued prompts. | Cancels the running operation. |
31+
| {% data variables.product.prodname_copilot_short %} is active and there are queued prompts. | Clears the queued prompts without stopping the current operation. |
32+
| A dialog, overlay, or picker is open. | Closes the dialog, overlay, or picker. |
33+
| {% data variables.product.prodname_copilot_short %} is idle. | Shows a brief reminder that pressing <kbd>Esc</kbd> again quickly will open the rewind picker. See [Rolling back changes](#rolling-back-changes). |
34+
35+
## When to use Esc instead of Ctrl+C
36+
37+
The main difference between these two ways of canceling an operation is that <kbd>Esc</kbd> is designed for gradual, targeted intervention, while <kbd>Ctrl</kbd>+<kbd>C</kbd> is a hard stop.
38+
39+
Use <kbd>Esc</kbd> when you want to interact with {% data variables.product.prodname_copilot_short %} without necessarily ending the current operation. For example, if a permission dialog appears and you want to deny that specific request, pressing <kbd>Esc</kbd> dismisses the dialog and {% data variables.product.prodname_copilot_short %} continues working—it just won't use the tool you denied. Similarly, if you've queued follow-up prompts and want to cancel them without interrupting the work already in progress, <kbd>Esc</kbd> clears the queue while the current operation keeps running. Pressing <kbd>Esc</kbd> only cancels the operation outright if there are no dialogs open and no queued prompts to clear first.
40+
41+
Use <kbd>Ctrl</kbd>+<kbd>C</kbd> when you want to stop everything at once. It immediately cancels the active operation and clears any queued prompts in a single keypress. Any file write that is already in progress will complete—files are not left corrupted mid-write—but any remaining planned changes are abandoned. Pressing <kbd>Ctrl</kbd>+<kbd>C</kbd> a second time within two seconds, when the input area is empty, exits the session entirely.
42+
43+
As a rule of thumb, use <kbd>Esc</kbd> when you want to intervene selectively, and <kbd>Ctrl</kbd>+<kbd>C</kbd> when you want to stop and start over.
44+
45+
## Rolling back changes
46+
47+
While {% data variables.product.prodname_copilot_short %} is inactive and there is no text in the input area, you can press <kbd>Esc</kbd> twice to display a list of points in your current session that you can roll back to. Each point corresponds to a snapshot of your workspace that was taken immediately before {% data variables.product.prodname_copilot_short %} started working on the prompt shown in the list.
48+
49+
For full details of how to use the double <kbd>Esc</kbd> keypress to roll back changes made during a session, see [AUTOTITLE](/copilot/how-tos/copilot-cli/roll-back-changes).
50+
51+
> [!WARNING]
52+
> {% data reusables.copilot.copilot-cli.cli-rewind-warning %}
53+
54+
### What happens when you roll back
55+
56+
When you select a snapshot from the rewind picker, the following actions occur:
57+
58+
1. **Git state is restored.** The repository is checked out to the Git commit and branch recorded in the snapshot.
59+
1. **Untracked files are cleaned.** Files that did not exist at the time of the snapshot are removed.
60+
1. **Modified files are restored.** Files that were changed after the snapshot are reverted to their backed-up state, including permissions and staging state.
61+
1. **Session history is truncated.** The conversation is rewound to the point where the selected snapshot was taken. All messages and tool calls that occurred after that point are removed from the session.
62+
1. **Snapshots are removed.** The selected snapshot and all snapshots after it are permanently deleted. Only snapshots from earlier conversation steps remain available for future rewinds.
63+
1. **Rollback confirmed.** After the rollback, {% data variables.product.prodname_copilot_short %} displays a message indicating how many files were restored.
64+
1. **Your prompt is restored.** The prompt associated with the selected snapshot is placed in the input area.
65+
66+
### Changes that can't be rolled back
67+
68+
Rewind is unavailable in the following situations:
69+
70+
* **Files over 10 MB.** Individual files larger than 10 MB are skipped during snapshot creation. Changes to these files are not restored during a rollback.
71+
* **More than 500 changed files.** If more than 500 files were changed during a single step of a CLI conversation, a snapshot is not created for that step. You will not be able to roll back changes made in that step. Earlier snapshots are unaffected.
72+
73+
## Further reading
74+
75+
* [AUTOTITLE](/copilot/reference/copilot-cli-reference/cli-command-reference)

content/copilot/concepts/agents/copilot-cli/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ versions:
88
children:
99
- /about-copilot-cli
1010
- /comparing-cli-features
11+
- /cancel-and-roll-back
1112
- /about-remote-access
1213
- /about-custom-agents
1314
- /about-cli-plugins

content/copilot/how-tos/copilot-cli/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,11 @@ children:
2525
- /use-copilot-cli-agents
2626
- /administer-copilot-cli-for-your-enterprise
2727
- /speed-up-task-completion
28+
- /roll-back-changes
2829
- /chronicle
2930
- /content/copilot/concepts/agents/copilot-cli/about-copilot-cli
3031
- /content/copilot/concepts/agents/copilot-cli/comparing-cli-features
32+
- /content/copilot/concepts/agents/copilot-cli/cancel-and-roll-back
3133
- /content/copilot/concepts/agents/about-agent-skills
3234
- /content/copilot/concepts/agents/copilot-cli/about-cli-plugins
3335
- /content/copilot/concepts/agents/copilot-cli/autopilot
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
---
2+
title: Rolling back changes made during a {% data variables.copilot.copilot_cli %} session
3+
shortTitle: Roll back changes
4+
intro: 'Rewind your {% data variables.copilot.copilot_cli_short %} session to a previous prompt to undo changes and restore your repository to a previous state.'
5+
versions:
6+
feature: copilot
7+
contentType: how-tos
8+
category:
9+
- Author and optimize with Copilot # Copilot discovery page
10+
- Build with Copilot CLI # Copilot CLI bespoke page
11+
docsTeamMetrics:
12+
- copilot-cli
13+
---
14+
15+
## Introduction
16+
17+
When you work in an interactive {% data variables.copilot.copilot_cli_short %} session, {% data variables.product.prodname_copilot_short %} can make changes to files, run shell commands, and modify your repository. If the result isn't what you expected, you can rewind to a previous point in the session to undo those changes.
18+
19+
When you enter a prompt, the first thing {% data variables.copilot.copilot_cli_short %} does is take a snapshot of your workspace state. This snapshot allows you to roll back to that point in the session if you need to. You can trigger a rewind by pressing <kbd>Esc</kbd> twice, or by using the `/undo` slash command.
20+
21+
This article explains how to roll back changes. For more conceptual information about rewinding to an earlier point in a session, see [AUTOTITLE](/copilot/concepts/agents/copilot-cli/cancel-and-roll-back).
22+
23+
## Prerequisites
24+
25+
* **You must be working in a Git repository with at least one commit.** {% data variables.copilot.copilot_cli_short %} uses Git operations to track and restore workspace state.
26+
* **A snapshot must exist.** Snapshots are created automatically at the start of each of your interactions with {% data variables.product.prodname_copilot_short %} in a CLI session. You can't roll back changes made before your first prompt in a session, or to the repository state for a step where snapshot creation was skipped, see [Changes that can't be rolled back](/copilot/concepts/agents/copilot-cli/cancel-and-roll-back#changes-that-cant-be-rolled-back).
27+
28+
## Rolling back with a double Esc keypress
29+
30+
> [!WARNING]
31+
> * {% data reusables.copilot.copilot-cli.cli-rewind-warning %}
32+
> * Rewinding cannot be undone. Once you roll back to a snapshot, all snapshots and session history after that point are permanently removed.
33+
34+
When {% data variables.product.prodname_copilot_short %} has finished responding to a prompt you've entered:
35+
36+
1. Make sure the input area is empty. If there's text in the input area, pressing <kbd>Esc</kbd> twice in quick succession clears the text.
37+
1. Press <kbd>Esc</kbd> twice in quick succession to open the rewind picker.
38+
39+
The rewind picker lists the available snapshots for the current session, with the most recent first. The ten most recent snapshots are displayed. If there are more than ten snapshots available you can use the <kbd>↓</kbd> arrow key to scroll down through earlier snapshots.
40+
41+
For each snapshot, the beginning of the prompt you entered is shown, with an indication of how long ago you submitted it.
42+
43+
1. Choose a snapshot to roll back to. This will return you to the state of the repository when you entered the associated prompt.
44+
45+
> [!NOTE]
46+
> The repository is rolled back to its state immediately before {% data variables.product.prodname_copilot_short %} started working on the prompt, not immediately after it finished working on the prompt.
47+
48+
The prompt you selected is shown in the input area, so you can edit and resubmit it, if required.
49+
50+
## Rolling back with the `/undo` slash command
51+
52+
The `/undo` slash command, and its alias `/rewind`, provide an alternative way of opening the rewind picker.
53+
54+
Both commands produce the same result that you get by pressing <kbd>Esc</kbd> twice when {% data variables.product.prodname_copilot_short %} is idle and there is no text in the input area.
55+
56+
## Verifying the rollback
57+
58+
After rolling back, you can use Git commands to verify the state of your repository and confirm that it matches your expectations.
59+
60+
Typing `!` allows you to run shell commands directly from the {% data variables.copilot.copilot_cli_short %} input prompt, so you don't need to exit the CLI to check the repository state.
61+
62+
| To do this | Enter this command |
63+
| ---------- | ------------------------ |
64+
| Check which files show as modified, staged, or untracked. | `! git status` |
65+
| Show the SHA and commit message of the current commit. | `! git log --oneline -1` |
66+
| Review the unstaged changes. | `! git diff` |
67+
68+
## Further reading
69+
70+
* [AUTOTITLE](/copilot/reference/copilot-cli-reference/cli-command-reference)

content/copilot/how-tos/copilot-sdk/troubleshooting/sdk-and-cli-compatibility.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ contentType: how-tos
118118
| Screen reader mode | `--screen-reader` | Accessibility |
119119
| Rich diff rendering | `--plain-diff` | Terminal rendering |
120120
| Startup banner | `--banner` | Visual element |
121-
| Streamer mode | `/streamer-mode` | TUI display mode |
122121
| Alternate screen buffer | `--alt-screen`, `--no-alt-screen` | Terminal rendering |
123122
| Mouse support | `--mouse`, `--no-mouse` | Terminal input |
124123
| **Path/Permission Shortcuts** | | |

content/copilot/how-tos/use-copilot-agents/cloud-agent/customize-the-agent-environment.md

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ redirect_from:
1313
- /copilot/how-tos/agents/copilot-coding-agent/customize-the-agent-environment
1414
- /copilot/how-tos/agents/coding-agent/customize-the-agent-environment
1515
contentType: how-tos
16-
category:
16+
category:
1717
- Configure Copilot
1818
---
1919

@@ -110,28 +110,7 @@ In its ephemeral development environment, {% data variables.product.prodname_cop
110110

111111
You can use a Copilot setup steps file to deterministically install tools or dependencies before {% data variables.product.prodname_copilot_short %} starts work. To do this, add `steps` to the `copilot-setup-steps` job:
112112

113-
```yaml
114-
# ...
115-
116-
jobs:
117-
copilot-setup-steps:
118-
# ...
119-
120-
# You can define any steps you want, and they will run before the agent starts.
121-
# If you do not check out your code, Copilot will do this for you.
122-
steps:
123-
- name: Checkout code
124-
uses: {% data reusables.actions.action-checkout %}
125-
126-
- name: Set up Node.js
127-
uses: {% data reusables.actions.action-setup-node %}
128-
with:
129-
node-version: "20"
130-
cache: "npm"
131-
132-
- name: Install JavaScript dependencies
133-
run: npm ci
134-
```
113+
{% data reusables.copilot.cloud-agent.install-dependencies %}
135114

136115
## Upgrading to larger {% data variables.product.prodname_dotcom %}-hosted {% data variables.product.prodname_actions %} runners
137116

@@ -158,14 +137,14 @@ By default, {% data variables.product.prodname_copilot_short %} works in a stand
158137

159138
## Using self-hosted {% data variables.product.prodname_actions %} runners
160139

161-
You can run {% data variables.copilot.copilot_cloud_agent %} on self-hosted runners. You may want to do this to match how you run CI/CD workflows on {% data variables.product.prodname_actions %}, or to give {% data variables.product.prodname_copilot_short %} access to internal resources on your network.
140+
You can run {% data variables.copilot.copilot_cloud_agent %} on self-hosted runners. You may want to do this to match how you run CI/CD workflows on {% data variables.product.prodname_actions %}, or to give {% data variables.product.prodname_copilot_short %} access to internal resources on your network.
162141

163142
We recommend that you only use {% data variables.copilot.copilot_cloud_agent %} with ephemeral, single-use runners that are not reused for multiple jobs. Most customers set this up using ARC (Actions Runner Controller) or the {% data variables.product.prodname_actions %} Runner Scale Set Client. For more information, see [AUTOTITLE](/actions/reference/runners/self-hosted-runners#supported-autoscaling-solutions).
164143

165144
> [!NOTE]
166145
> {% data variables.copilot.copilot_cloud_agent %} is only compatible with Ubuntu x64 and Windows 64-bit runners. Runners with macOS or other operating systems are not supported.
167146

168-
1. Configure network security controls for your {% data variables.product.prodname_actions %} runners to ensure that {% data variables.copilot.copilot_cloud_agent %} does not have open access to your network or the public internet.
147+
1. Configure network security controls for your {% data variables.product.prodname_actions %} runners to ensure that {% data variables.copilot.copilot_cloud_agent %} does not have open access to your network or the public internet.
169148

170149
You must configure your firewall to allow connections to the [standard hosts required for {% data variables.product.prodname_actions %} self-hosted runners](/actions/reference/runners/self-hosted-runners#accessible-domains-by-function), plus the following hosts:
171150

@@ -193,7 +172,7 @@ We recommend that you only use {% data variables.copilot.copilot_cloud_agent %}
193172

194173
## Switching {% data variables.product.prodname_copilot_short %} to a Windows development environment
195174

196-
By default, {% data variables.product.prodname_copilot_short %} uses an Ubuntu Linux-based development environment.
175+
By default, {% data variables.product.prodname_copilot_short %} uses an Ubuntu Linux-based development environment.
197176

198177
You may want to use a Windows development environment if you're building software for Windows or your repository uses a Windows-based toolchain so {% data variables.product.prodname_copilot_short %} can build your project, run tests and validate its work.
199178

content/copilot/how-tos/use-copilot-agents/cloud-agent/extend-cloud-agent-with-mcp.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ The [Sentry MCP server](https://github.com/getsentry/sentry-mcp) gives {% data v
129129
// We can use the $SENTRY_HOST environment variable which is passed to
130130
// the server because of the `env` value below.
131131
"args": ["@sentry/mcp-server@latest", "--host=$SENTRY_HOST"],
132-
"tools": ["get_issue_details", "get_issue_summary"],
133132
"env": {
134133
// We can specify an environment variable value as a string...
135134
"SENTRY_HOST": "https://contoso.sentry.io",

0 commit comments

Comments
 (0)