Questions tagged [rollback]

A rollback is reverting data to a previous state. Typically questions in this tag involve transactions in Relational Database Management Systems, where a ROLLBACK command is used to discard any changes to the data since a transaction started.

1545 questions
1032
votes
19 answers

How can I rollback a specific migration?

I have the migration file db\migrate\20100905201547_create_blocks.rb. How can I specifically rollback that migration file?
AnApprentice
  • 108,152
  • 195
  • 629
  • 1,012
578
votes
24 answers

Rails DB Migration - How To Drop a Table?

I added a table that I thought I was going to need, but now no longer plan on using it. How should I remove that table? I've already run migrations, so the table is in my database. I figure rails generate migration should be able to handle this, but…
243
votes
9 answers

Entity Framework rollback and remove bad migration

I'm using EF 6.0 for my project in C# with manual migrations and updates. I have about 5 migrations on the database, but I realised that the last migration was bad and I don't want it. I know that I can rollback to a previous migration, but when I…
Martin Brabec
  • 3,720
  • 2
  • 23
  • 26
175
votes
15 answers

How to discard all changes made to a branch?

I'm working in a branch (i.e. design) and I've made a number of changes, but I need to discard them all and reset it to match the repository version. I thought git checkout design would do it, but it just tells me I'm already in branch design and…
Will
  • 5,370
  • 9
  • 35
  • 48
162
votes
6 answers

How do I view an older version of an SVN file?

I have an SVN file which is now missing some logic and so I need to go back about 40 revisions to the time when it had the logic I need. Other than trying to view a diff of the file in the command line (very hard to read), is there any way I could…
Xeoncross
  • 55,620
  • 80
  • 262
  • 364
135
votes
13 answers

Undo changes in entity framework entities

this might be a trivial question but: Since ADO.NET entity framework automatically tracks changes (in generated entities) and therefore keeps the original values, how can I rollback changes made to the entity objects? I have a form which allows the…
MartinStettner
  • 28,719
  • 15
  • 79
  • 106
112
votes
7 answers

How to revert (Roll Back) a checkin in TFS 2010

Can anyone tell me how to revert (roll back) a checkin in TFS 2010?
devlife
  • 15,275
  • 27
  • 77
  • 131
93
votes
17 answers

How do I rollback a TFS check-in?

I'd like to rollback a change I made recently in TFS. In Subversion, this was pretty straightforward. However, it seems to be an incredible headache in TFS: Option 1: Get Prior Version Manually get prior version of each file Check out for…
Jason
  • 86,222
  • 15
  • 131
  • 146
87
votes
3 answers

Will a using statement rollback a database transaction if an error occurs?

I've got an IDbTransaction in a using statement but I'm unsure if it will be rolled back if an exception is thrown in a using statement. I know that a using statement will enforce the calling of Dispose()...but does anyone know if the same is true…
mezoid
  • 28,090
  • 37
  • 107
  • 148
84
votes
12 answers

ActiveRecord::StatementInvalid: PG InFailedSqlTransaction

I am trying to create an ActiveRecord Object.But I'm getting this error while creating it. (0.1ms) ROLLBACK ActiveRecord::StatementInvalid: PG::InFailedSqlTransaction: ERROR: current transaction is aborted, commands ignored until end of…
untwal
  • 1,017
  • 1
  • 9
  • 17
74
votes
3 answers

How do you "rollback" last commit on Mercurial?

I have a Mercurial repository that I use in local only... It's for my personal usage (so I don't "push" anywhere). I made a commit with 3 files, but after that I understood that I should do commit 4 files... Is there a way to "rollback" my last…
serhio
  • 28,010
  • 62
  • 221
  • 374
68
votes
6 answers

How can I undo a mysql statement that I just executed?

How can I undo the most recently executed mysql query?
Hari kanna
  • 2,461
  • 6
  • 29
  • 43
65
votes
3 answers

How to roll back migrations using Flyway?

MyBatis migrations splits each SQL file into two sections: One for migrating forward one version One for migrating back one version How does one roll back versions using Flyway?
Gili
  • 86,244
  • 97
  • 390
  • 689
64
votes
9 answers

Git rollback 1 pull

I have a web server that serves a project that is a git repository. When I do some changes to the code I then do a git pull from the server. Sometimes the new code just crashes, I would like to be able to do a rollback to the latest pull, the one…
Bastian
  • 5,625
  • 10
  • 44
  • 68
61
votes
10 answers

How can I roll back my last delete command in MySQL?

I accidentally deleted some huge number of rows from a table... How can I roll it back? I executed the query using PuTTY. I'll be grateful if any of you can guide me safely out of this...
Vijay
  • 5,331
  • 10
  • 54
  • 88
1
2 3
99 100