Update egit help for 0.8.0 from wiki
[egit.git] / org.eclipse.egit.doc / help / EGit / User_Guide / Reverting-Changes.html
blob487f3b6dddd360860cbd07ba876763f06f244f71
1 <?xml version='1.0' encoding='utf-8' ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <html xmlns="http://www.w3.org/1999/xhtml">
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
5 <title>EGit User Guide - Reverting Changes</title>
6 <link type="text/css" rel="stylesheet" href="../../book.css"/>
7 </head>
8 <body>
9 <table class="navigation" style="width: 100%;" border="0" summary="navigation">
10 <tr>
11 <th style="width: 100%" align="center" colspan="3">Reverting Changes</th>
12 </tr>
13 <tr>
14 <td style="width: 20%" align="left">
15 <a href="Committing-Changes.html" title="Committing Changes">
16 <img alt="Previous" border="0" src="../../images/prev.gif"/>
17 </a>
18 </td>
19 <td style="width: 60%" align="center"></td>
20 <td style="width: 20%" align="right">
21 <a href="Branching.html" title="Branching">
22 <img alt="Next" border="0" src="../../images/next.gif"/>
23 </a>
24 </td>
25 </tr>
26 <tr>
27 <td style="width: 20%" align="left" valign="top">Committing Changes</td>
28 <td style="width: 60%" align="center"></td>
29 <td style="width: 20%" align="right" valign="top">Branching</td>
30 </tr>
31 </table><hr/>
32 <h1 id="Reverting_Changes">Reverting Changes</h1>
33 <h2 id="Reverting_changes_in_the_working_tree">Reverting changes in the working tree</h2>
34 <h3 id="Replace_with_File_in_Git_Index">Replace with File in Git Index</h3>
35 <p>Changes which are not yet committed and not yet staged can be reverted for a set of selected files.
36 Select the file(s) in the Package Explorer or an analogous view and select</p>
37 <p>
38 <img border="0" src="images/ReplaceWithGitIndex.png"/>
39 </p>
40 <h3 id="Replace_with_HEAD">Replace with HEAD</h3>
41 <p>This feature is currently not available on single file level. You can use
42 <b>Reset to</b> with the option
43 <b>hard</b> to set the whole working tree of your repository to the state of the HEAD commit (See "Resetting your current HEAD" below). By this you revert all changes in the working tree and the index. You can't do it on a selected set of files yet.
44 </p>
45 <h2 id="Resetting_your_current_HEAD">Resetting your current HEAD</h2>
46 <p>Git offers the possibility to reset the HEAD of the current branch to any other commit. It optionally resets the index and the working tree to match that commit. Note that this action affects all files and folders in the whole repository.</p>
47 <p>You have the option to do a hard reset, a mixed reset and a soft reset.</p>
48 <ul>
49 <li>
50 <b>soft</b> - the HEAD points now to the new commit, the index and the working tree are unchanged
51 </li>
52 <li>
53 <b>mixed</b> - the HEAD points now to the new commit, the index is updated, the working tree is unchanged
54 </li>
55 <li>
56 <b>hard</b> - the HEAD points now to the new commit, the index and the working tree are updated
57 </li>
58 </ul>
59 <h3 id="Reset_to_specific_branch_or_tag">Reset to specific branch or tag</h3>
60 <p>Select
61 <b>Team -&gt; Reset...</b> on a project. This opens a dialog where you can select a branch or a tag.
62 </p>
63 <h3 id="Reset_to_a_specific_commit">Reset to a specific commit</h3>
64 <p>Select a commit in the History view and open the context menu. Here you find the entries
65 <b>Hard reset</b>,
66 <b>Mixed reset</b> and
67 <b>Soft reset</b>.
68 </p>
69 <h3 id="Revert_all_local_and_staged_changes">Revert all local and staged changes</h3>
70 <p>This can be done as a special case of reset. If you reset to the current HEAD (normally the last commit on your branch) with the option
71 <b>hard</b> you overwrite the working tree and the index with the content of the HEAD. You can do this in two ways:
72 </p>
73 <ul>
74 <li>Select
75 <b>Team &gt; Reset...</b> on a project. In the dialog select HEAD or your current branch and switch the radio button to "hard".
76 </li>
77 <li>Open the context menu on the HEAD commit in the history view and select
78 <b>Hard Reset</b>.
79 </li>
80 </ul><hr/>
81 <table class="navigation" style="width: 100%;" border="0" summary="navigation">
82 <tr>
83 <td style="width: 20%" align="left">
84 <a href="Committing-Changes.html" title="Committing Changes">
85 <img alt="Previous" border="0" src="../../images/prev.gif"/>
86 </a>
87 </td>
88 <td style="width: 60%" align="center">
89 <a href="User-Guide.html" title="EGit User Guide">
90 <img alt="EGit User Guide" border="0" src="../../images/home.gif"/>
91 </a>
92 </td>
93 <td style="width: 20%" align="right">
94 <a href="Branching.html" title="Branching">
95 <img alt="Next" border="0" src="../../images/next.gif"/>
96 </a>
97 </td>
98 </tr>
99 <tr>
100 <td style="width: 20%" align="left" valign="top">Committing Changes</td>
101 <td style="width: 60%" align="center"></td>
102 <td style="width: 20%" align="right" valign="top">Branching</td>
103 </tr>
104 </table>
105 </body>
106 </html>